Skip to content

Commit

Permalink
Fix blank unread count query
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilander committed Feb 17, 2017
1 parent 9eef4fc commit 93522f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/channel.go
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 93522f7

Please sign in to comment.