diff --git a/app/channel.go b/app/channel.go index c705b1f2a9..e678955a90 100644 --- a/app/channel.go +++ b/app/channel.go @@ -1800,7 +1800,7 @@ func (a *App) MarkChannelAsUnreadFromPost(postID string, userID string) (*model. } channelUnread, updateErr := a.Srv.Store.Channel().UpdateLastViewedAtPost(post, userID, unreadMentions) - if err != nil { + if updateErr != nil { return channelUnread, updateErr } diff --git a/app/post_test.go b/app/post_test.go index 1aafc913c0..458a6fa161 100644 --- a/app/post_test.go +++ b/app/post_test.go @@ -1276,6 +1276,7 @@ func TestCountMentionsFromPost(t *testing.T) { ChannelId: channel.Id, Message: "test", }, channel, false) + require.Nil(t, err) count, err := th.App.countMentionsFromPost(user2, post1)