diff --git a/src/SlashCommands.js b/src/SlashCommands.js index 6a4127f4b5..115cf0e018 100644 --- a/src/SlashCommands.js +++ b/src/SlashCommands.js @@ -148,7 +148,7 @@ export const CommandMap = { if (!room) return reject('Bad room ID: ' + roomId); const topicEvents = room.currentState.getStateEvents('m.room.topic', ''); - const topic = topicEvents.getContent().topic; + const topic = topicEvents && topicEvents.getContent().topic; const topicHtml = topic ? linkifyAndSanitizeHtml(topic) : _t('This room has no topic.'); const InfoDialog = sdk.getComponent('dialogs.InfoDialog');