diff --git a/app/components/autocomplete/channel_mention_item/channel_mention_item.js b/app/components/autocomplete/channel_mention_item/channel_mention_item.js index 4257a3c72..6bdfcc7f7 100644 --- a/app/components/autocomplete/channel_mention_item/channel_mention_item.js +++ b/app/components/autocomplete/channel_mention_item/channel_mention_item.js @@ -24,9 +24,7 @@ export default class ChannelMentionItem extends PureComponent { completeMention = () => { const {onPress, displayName, name, type} = this.props; - if (type === General.DM_CHANNEL) { - onPress('@' + displayName.replace(/ /g, '')); - } else if (type === General.DM_CHANNEL) { + if (type === General.DM_CHANNEL || type === General.GM_CHANNEL) { onPress('@' + displayName.replace(/ /g, '')); } else { onPress(name); @@ -45,6 +43,9 @@ export default class ChannelMentionItem extends PureComponent { const style = getStyleFromTheme(theme); if (type === General.DM_CHANNEL || type === General.GM_CHANNEL) { + if (!displayName) { + return null; + } return (