Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Fix JS error when switching teams mid channel switch (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilander committed Jan 3, 2018
1 parent 78d7617 commit fe473ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utils/utils.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -948,9 +948,10 @@ export function isMobile() {
}

export function getDirectTeammate(channelId) {
var userIds = ChannelStore.get(channelId).name.split('__');
var curUserId = UserStore.getCurrentId();
var teammate = {};
const channel = ChannelStore.get(channelId) || {};
const userIds = channel.name.split('__');
const curUserId = UserStore.getCurrentId();
let teammate = {};

if (userIds.length !== 2 || userIds.indexOf(curUserId) === -1) {
return teammate;
Expand Down

0 comments on commit fe473ad

Please sign in to comment.