Fix nil dereference panic in SearchArchivedInTeam (#16064)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Claudio Costa
2020-10-26 15:19:14 +01:00
коммит произвёл GitHub
родитель 72432ab3ff
Коммит 9484366784
2 изменённых файлов: 31 добавлений и 4 удалений

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

@@ -2544,15 +2544,19 @@ func (s SqlChannelStore) SearchArchivedInTeam(teamId string, term string, userId
"UserId": userId,
})
output := *publicChannels
output = append(output, *privateChannels...)
outputErr := publicErr
if privateErr != nil {
outputErr = privateErr
}
return &output, outputErr
if outputErr != nil {
return nil, outputErr
}
output := *publicChannels
output = append(output, *privateChannels...)
return &output, nil
}
func (s SqlChannelStore) SearchForUserInTeam(userId string, teamId string, term string, includeDeleted bool) (*model.ChannelList, error) {