From 67dd6c1ec6e53923eef892c15a59cc269e9db037 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 13 Feb 2017 13:23:39 -0500 Subject: Fix unread error (#5390) --- app/channel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/channel.go b/app/channel.go index 194a43f69..ab832693f 100644 --- a/app/channel.go +++ b/app/channel.go @@ -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) } } -- cgit v1.2.3-1-g7c22