From 307c16df5f134f687a669f0efe0bf9bcb1c27437 Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Thu, 31 Mar 2016 11:10:57 -0400
Subject: Fixed errors when joining a channel that doesn't exist yet

---
 webapp/components/popover_list_members.jsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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

diff --git a/webapp/components/popover_list_members.jsx b/webapp/components/popover_list_members.jsx
index cd583e4c3..f21b8ee1c 100644
--- a/webapp/components/popover_list_members.jsx
+++ b/webapp/components/popover_list_members.jsx
@@ -57,7 +57,11 @@ export default class PopoverListMembers extends React.Component {
         const members = this.props.members;
         const teamMembers = UserStore.getProfilesUsernameMap();
         const currentUserId = UserStore.getCurrentId();
-        const ch = ChannelStore.getCurrent();
+        const ch = ChannelStore.get(this.props.channelId);
+
+        if (!ch) {
+            return null;
+        }
 
         if (members && teamMembers) {
             members.sort((a, b) => {
-- 
cgit v1.2.3-1-g7c22

