From 5c37155730d343dc5e5f53ad2b12cb57d28aa9d7 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 3 Nov 2017 18:18:09 -0600 Subject: [PATCH] Don't assume we have a valid event. Signed-off-by: Travis Ralston --- src/components/views/rooms/RoomHeader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index 2a06a90391..dcfb2e5a7c 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -156,8 +156,8 @@ module.exports = React.createClass({ } const readPinsEvent = this.props.room.getAccountData("im.vector.room.read_pins"); - if (readPinsEvent) { - const readStateEvents = readPinsEvent.getContent().event_ids; + if (readPinsEvent && readPinsEvent.getContent()) { + const readStateEvents = readPinsEvent.getContent().event_ids || []; if (readStateEvents) { return !readStateEvents.includes(currentPinEvent.getId()); }