Don't assume we have a valid event.

Signed-off-by: Travis Ralston <travpc@gmail.com>
pull/21833/head
Travis Ralston 2017-11-03 18:18:09 -06:00
parent 3656fdb571
commit 5c37155730
1 changed files with 2 additions and 2 deletions

View File

@ -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());
}