mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-20 14:01:25 +02:00
Merge pull request #1602 from matrix-org/dbkr/nullcheck_atroom_rule
Don't crash if there isn't a room notif rule
This commit is contained in:
commit
d2549b621c
@ -224,7 +224,7 @@ module.exports = React.createClass({
|
|||||||
if (roomNotifTextNodes.length > 0) {
|
if (roomNotifTextNodes.length > 0) {
|
||||||
const pushProcessor = new PushProcessor(MatrixClientPeg.get());
|
const pushProcessor = new PushProcessor(MatrixClientPeg.get());
|
||||||
const atRoomRule = pushProcessor.getPushRuleById(".m.rule.roomnotif");
|
const atRoomRule = pushProcessor.getPushRuleById(".m.rule.roomnotif");
|
||||||
if (pushProcessor.ruleMatchesEvent(atRoomRule, this.props.mxEvent)) {
|
if (atRoomRule && pushProcessor.ruleMatchesEvent(atRoomRule, this.props.mxEvent)) {
|
||||||
// Now replace all those nodes with Pills
|
// Now replace all those nodes with Pills
|
||||||
for (const roomNotifTextNode of roomNotifTextNodes) {
|
for (const roomNotifTextNode of roomNotifTextNodes) {
|
||||||
const pillContainer = document.createElement('span');
|
const pillContainer = document.createElement('span');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user