[MM-60886] Fix TypeAssertionError in api4.addChannelMember (#28976)

* Fix TypeAssertionError in api4.addChannelMember

* Fix
Этот коммит содержится в:
Claudio Costa
2024-10-28 12:52:23 -06:00
коммит произвёл GitHub
родитель a65ba84697
Коммит b4f337f191
2 изменённых файлов: 41 добавлений и 1 удалений

Просмотреть файл

@@ -1780,7 +1780,14 @@ func addChannelMember(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
for _, userId := range interfaceIds {
userIds = append(userIds, userId.(string))
uid, isString := userId.(string)
if !isString || !model.IsValidId(uid) {
c.SetInvalidParam("user_id in user_ids")
return
}
userIds = append(userIds, uid)
}
} else {
userId, ok2 := props["user_id"].(string)