[MM-32253] Fix "Cannot mark unread a DM message in a thread" (#16794)

Automatic Merge
Этот коммит содержится в:
Daniel Espino García
2021-02-01 14:52:27 +01:00
коммит произвёл GitHub
родитель 13616cac0f
Коммит ff970e080b
2 изменённых файлов: 9 добавлений и 5 удалений

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

@@ -837,7 +837,7 @@ func (a *App) getGroupsAllowedForReferenceInChannel(channel *model.Channel, team
groupsMap := make(map[string]*model.Group)
opts := model.GroupSearchOpts{FilterAllowReference: true}
if channel.IsGroupConstrained() || team.IsGroupConstrained() {
if channel.IsGroupConstrained() || (team != nil && team.IsGroupConstrained()) {
var groups []*model.GroupWithSchemeAdmin
if channel.IsGroupConstrained() {
groups, err = a.Srv().Store.Group().GetGroupsByChannel(channel.Id, opts)