Fix unread error (#5390)

This commit is contained in:
Joram Wilander
2017-02-13 13:23:39 -05:00
committed by GitHub
parent 0a21eed004
commit 67dd6c1ec6

View File

@@ -858,7 +858,7 @@ func ViewChannel(view *model.ChannelView, teamId string, userId string, clearPus
if len(view.PrevChannelId) > 0 {
channelIds = append(channelIds, view.PrevChannelId)
if *utils.Cfg.EmailSettings.SendPushNotifications && clearPushNotifications {
if *utils.Cfg.EmailSettings.SendPushNotifications && clearPushNotifications && len(view.ChannelId) > 0 {
pchan = Srv.Store.User().GetUnreadCountForChannel(userId, view.ChannelId)
}
}