diff --git a/src/ScalarMessaging.js b/src/ScalarMessaging.js index bc5e6b7fe1..ba60af29d1 100644 --- a/src/ScalarMessaging.js +++ b/src/ScalarMessaging.js @@ -307,9 +307,7 @@ function waitForUserWidget(widgetId) { } function onAccountData(ev) { - if (ev.getType() != 'm.widgets') return; - - if (ev.getContent() && ev.getContent()[widgetId] !== undefined) { + if (ev.getType() === 'm.widgets' && ev.getContent() && ev.getContent()[widgetId] !== undefined) { MatrixClientPeg.get().removeListener('accountData', onAccountData); clearTimeout(timerId); resolve();