summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/channel.go2
1 files changed, 1 insertions, 1 deletions
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)
}
}