From 4208e42ba9df02b9c4bd7081179922c21206d83d Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Thu, 12 Jan 2017 10:52:58 -0500
Subject: Fix JS error when receiving message in system console (#5019)

---
 webapp/stores/notification_store.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'webapp/stores/notification_store.jsx')

diff --git a/webapp/stores/notification_store.jsx b/webapp/stores/notification_store.jsx
index 878ac3c9d..4c89fe480 100644
--- a/webapp/stores/notification_store.jsx
+++ b/webapp/stores/notification_store.jsx
@@ -111,7 +111,7 @@ class NotificationStoreClass extends EventEmitter {
             // the window itself is not active
             const activeChannel = ChannelStore.getCurrent();
             const channelId = channel ? channel.id : null;
-            const notify = activeChannel.id !== channelId || !this.inFocus;
+            const notify = (activeChannel && activeChannel.id !== channelId) || !this.inFocus;
 
             if (notify) {
                 Utils.notifyMe(title, body, channel, teamId, duration, !sound);
-- 
cgit v1.2.3-1-g7c22

