From db1e1c7df0151a5b3322dbc08e4eeb48b6fca3b5 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 26 Feb 2016 23:05:41 +0000 Subject: [PATCH] Fix NPE when re-joining a room Fix the length check on state.events --- src/components/structures/TimelinePanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index ce771c3bcd..202d29c021 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -439,7 +439,7 @@ var TimelinePanel = React.createClass({ // the messagePanel doesn't know where the read marker is. // if we know the timestamp of the read marker, make a guess based on that. var rmTs = TimelinePanel.roomReadMarkerTsMap[this.props.room.roomId]; - if (rmTs && this.state.events) { + if (rmTs && this.state.events.length > 0) { if (rmTs < this.state.events[0].getTs()) { return -1; } else {