From a88ff1b64d4238e2a94b885cd0a6feed35a5c9b5 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 28 Jul 2016 08:41:17 -0400 Subject: [PATCH] Fix console error when receiving a new message in the system console or on another team (#3688) --- webapp/actions/post_actions.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webapp/actions/post_actions.jsx b/webapp/actions/post_actions.jsx index ae359d7f2b..7d830d11b5 100644 --- a/webapp/actions/post_actions.jsx +++ b/webapp/actions/post_actions.jsx @@ -22,8 +22,10 @@ export function handleNewPost(post, msg) { } else { AsyncClient.getChannel(post.channel_id); } - } else if (msg && (TeamStore.getCurrentId() === msg.team_id || msg.props.channel_type === Constants.DM_CHANNEL)) { - AsyncClient.getChannel(post.channel_id); + } else if (msg && (TeamStore.getCurrentId() === msg.team_id || msg.data.channel_type === Constants.DM_CHANNEL)) { + if (Client.teamId) { + AsyncClient.getChannel(post.channel_id); + } } var websocketMessageProps = null;