1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Fix exception whilst syncing

event.getPushRules() may return null (for better or worse...).
Use client.getPushRulesForEvent which will calculate them if they
haven't already been calculated.

Fixes https://github.com/vector-im/riot-web/issues/10269
This commit is contained in:
David Baker
2019-07-05 10:26:47 +01:00
parent 1083efc212
commit 093f139d34

View File

@@ -310,7 +310,7 @@ function MatrixClient(opts) {
break;
}
highlightCount += event.getPushActions().tweaks.highlight ? 1 : 0;
highlightCount += this.getPushActionsForEvent(event).tweaks.highlight ? 1 : 0;
}
// Note: we don't need to handle 'total' notifications because the counts