Fix crash accessing property of undefined teammate

This commit is contained in:
Elias Nahum 2019-09-17 09:00:58 -03:00
parent 4d8fa314d1
commit 0811fd7149
No known key found for this signature in database
GPG key ID: E038DB71E0B61702

View file

@ -40,11 +40,11 @@ function makeMapStateToProps() {
} else {
const teammateId = getUserIdFromChannelName(currentUserId, channel.name);
const teammate = getUser(state, teammateId);
isArchived = teammate.delete_at > 0;
const teammateNameDisplay = getTeammateNameDisplaySetting(state);
displayName = displayUsername(teammate, teammateNameDisplay, false);
if (teammate && teammate.is_bot) {
isBot = true;
if (teammate) {
isArchived = teammate.delete_at > 0;
isBot = teammate.is_bot || false;
}
isGuest = isGuestUser(teammate);
}