Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit d2549b6

Browse files
authored
Merge pull request #1602 from matrix-org/dbkr/nullcheck_atroom_rule
Don't crash if there isn't a room notif rule
2 parents 981ca45 + ff5e00d commit d2549b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/views/messages/TextualBody.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ module.exports = React.createClass({
224224
if (roomNotifTextNodes.length > 0) {
225225
const pushProcessor = new PushProcessor(MatrixClientPeg.get());
226226
const atRoomRule = pushProcessor.getPushRuleById(".m.rule.roomnotif");
227-
if (pushProcessor.ruleMatchesEvent(atRoomRule, this.props.mxEvent)) {
227+
if (atRoomRule && pushProcessor.ruleMatchesEvent(atRoomRule, this.props.mxEvent)) {
228228
// Now replace all those nodes with Pills
229229
for (const roomNotifTextNode of roomNotifTextNodes) {
230230
const pillContainer = document.createElement('span');

0 commit comments

Comments
 (0)