null checks on room in onRoomTimeline
parent
4aef352a5c
commit
f4d939da81
|
@ -226,6 +226,7 @@ var Notifier = {
|
||||||
|
|
||||||
onRoomTimeline: function(ev, room, toStartOfTimeline, removed, data) {
|
onRoomTimeline: function(ev, room, toStartOfTimeline, removed, data) {
|
||||||
if (toStartOfTimeline) return;
|
if (toStartOfTimeline) return;
|
||||||
|
if (!room) return;
|
||||||
if (!this.isPrepared) return; // don't alert for any messages initially
|
if (!this.isPrepared) return; // don't alert for any messages initially
|
||||||
if (ev.sender && ev.sender.userId == MatrixClientPeg.get().credentials.userId) return;
|
if (ev.sender && ev.sender.userId == MatrixClientPeg.get().credentials.userId) return;
|
||||||
if (data.timeline.getTimelineSet() !== room.getUnfilteredTimelineSet()) return;
|
if (data.timeline.getTimelineSet() !== room.getUnfilteredTimelineSet()) return;
|
||||||
|
|
|
@ -340,6 +340,7 @@ module.exports = React.createClass({
|
||||||
if (this.unmounted) return;
|
if (this.unmounted) return;
|
||||||
|
|
||||||
// ignore events for other rooms
|
// ignore events for other rooms
|
||||||
|
if (!room) return;
|
||||||
if (!this.state.room || room.roomId != this.state.room.roomId) return;
|
if (!this.state.room || room.roomId != this.state.room.roomId) return;
|
||||||
|
|
||||||
// ignore events from filtered timelines
|
// ignore events from filtered timelines
|
||||||
|
|
Loading…
Reference in New Issue