[MM-52955] Fix panic for not found posts (#23561)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c94e8c2134
Коммит
9a55280d7a
@@ -41,6 +41,11 @@ func (s *SqlReactionStore) Save(reaction *model.Reaction) (re *model.Reaction, e
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed while getting channelId from Posts")
|
||||
}
|
||||
|
||||
if len(channelIds) == 0 {
|
||||
return nil, store.NewErrNotFound("Post", reaction.PostId)
|
||||
}
|
||||
|
||||
reaction.ChannelId = channelIds[0]
|
||||
}
|
||||
err = s.saveReactionAndUpdatePost(transaction, reaction)
|
||||
|
||||
Ссылка в новой задаче
Block a user