Fix blank unread count query (#5457)

This commit is contained in:
Joram Wilander
2017-02-17 14:18:37 -05:00
committed by Corey Hulen
parent 9eef4fc36a
commit 4aa576fc02
+1 -1
View File
@@ -1297,7 +1297,7 @@ func viewChannel(c *Context, w http.ResponseWriter, r *http.Request) {
if len(view.PrevChannelId) > 0 {
channelIds = append(channelIds, view.PrevChannelId)
if *utils.Cfg.EmailSettings.SendPushNotifications && !c.Session.IsMobileApp() {
if *utils.Cfg.EmailSettings.SendPushNotifications && !c.Session.IsMobileApp() && len(view.ChannelId) > 0 {
pchan = Srv.Store.User().GetUnreadCountForChannel(c.Session.UserId, view.ChannelId)
}
}