Commit f482eaa7 authored by Elias Nahum's avatar Elias Nahum Committed by Carlos Tadeu Panato Junior

Fix Opening the channel switch modal triggers a JS error when user is undefined (#1322)

parent 9ad645e5
......@@ -416,8 +416,14 @@ export default class SwitchChannelProvider extends Provider {
if (channel.type === Constants.GM_CHANNEL) {
wrappedChannel.name = getChannelDisplayName(channel);
} else if (channel.type === Constants.DM_CHANNEL) {
const user = getUser(getState(), Utils.getUserIdFromChannelId(channel.name));
if (!user) {
continue;
}
wrappedChannel = this.userWrappedChannel(
getUser(getState(), Utils.getUserIdFromChannelId(channel.name)),
user,
channel
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment