just use the one if statement

This commit is contained in:
David Baker 2018-05-15 15:02:24 +01:00
parent 7bfe84f8be
commit 5b781043a5

View file

@ -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();