1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

Fix wrongly asserting that PushRule::conditions is non-null (#2217)

This commit is contained in:
Michael Telatynski
2022-03-04 08:36:00 +00:00
committed by GitHub
parent 5d54bf558c
commit 9e4f109e80

View File

@@ -158,8 +158,7 @@ export class PushProcessor {
.find((r) => r.rule_id === override.rule_id);
if (existingRule) {
// Copy over the actions, default, and conditions. Don't touch the user's
// preference.
// Copy over the actions, default, and conditions. Don't touch the user's preference.
existingRule.default = override.default;
existingRule.conditions = override.conditions;
existingRule.actions = override.actions;
@@ -447,6 +446,8 @@ export class PushProcessor {
}
public ruleMatchesEvent(rule: IPushRule, ev: MatrixEvent): boolean {
if (!rule.conditions?.length) return true;
let ret = true;
for (let i = 0; i < rule.conditions.length; ++i) {
const cond = rule.conditions[i];