null checks on room in onRoomTimeline

pull/21833/head
Matthew Hodgson 2016-09-09 02:09:12 +01:00
parent 4aef352a5c
commit f4d939da81
2 changed files with 3 additions and 1 deletions

View File

@ -190,7 +190,7 @@ var Notifier = {
setToolbarHidden: function(hidden, persistent = true) {
this.toolbarHidden = hidden;
// XXX: why are we dispatching this here?
// this is nothing to do with notifier_enabled
dis.dispatch({
@ -226,6 +226,7 @@ var Notifier = {
onRoomTimeline: function(ev, room, toStartOfTimeline, removed, data) {
if (toStartOfTimeline) return;
if (!room) return;
if (!this.isPrepared) return; // don't alert for any messages initially
if (ev.sender && ev.sender.userId == MatrixClientPeg.get().credentials.userId) return;
if (data.timeline.getTimelineSet() !== room.getUnfilteredTimelineSet()) return;

View File

@ -340,6 +340,7 @@ module.exports = React.createClass({
if (this.unmounted) return;
// ignore events for other rooms
if (!room) return;
if (!this.state.room || room.roomId != this.state.room.roomId) return;
// ignore events from filtered timelines