From 3c0f8c29db3d5cc5901b1e30710f1b900980920a Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Mon, 21 Nov 2016 16:08:29 -0500
Subject: Fixed error being thrown by ChannelHeader when switching teams
 (#4619)

* Fixed error being thrown by ChannelHeader when switching teams

* Close SidebarHeaderDropdown after switching teams
---
 webapp/components/channel_header.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'webapp/components/channel_header.jsx')

diff --git a/webapp/components/channel_header.jsx b/webapp/components/channel_header.jsx
index 213f7fd0a..50b860287 100644
--- a/webapp/components/channel_header.jsx
+++ b/webapp/components/channel_header.jsx
@@ -69,7 +69,7 @@ export default class ChannelHeader extends React.Component {
         const users = UserStore.getProfileListInChannel(this.props.channelId);
 
         let otherUserId = null;
-        if (channel.type === 'D') {
+        if (channel && channel.type === 'D') {
             otherUserId = Utils.getUserIdFromChannelName(channel);
         }
 
-- 
cgit v1.2.3-1-g7c22

