From 5b781043a5b61ec2307a89d212d79faa3750a46c Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 15 May 2018 15:02:24 +0100 Subject: [PATCH] just use the one if statement --- src/ScalarMessaging.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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();