mirror of https://github.com/vector-im/riot-web
Don't crash if there isn't a room notif rule
parent
be5e67245b
commit
ff5e00d244
|
@ -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…
Reference in New Issue