From 951f0fc816f62272af4b8ad870ce570b3c72c861 Mon Sep 17 00:00:00 2001 From: Bastian Date: Wed, 6 Feb 2019 20:10:44 +0100 Subject: [PATCH] Fix error if topicEvents is undefined Signed-off-by: Bastian --- src/SlashCommands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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');