mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-07 06:58:25 +00:00
Don't assume we have a valid event.
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
@@ -156,8 +156,8 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const readPinsEvent = this.props.room.getAccountData("im.vector.room.read_pins");
|
const readPinsEvent = this.props.room.getAccountData("im.vector.room.read_pins");
|
||||||
if (readPinsEvent) {
|
if (readPinsEvent && readPinsEvent.getContent()) {
|
||||||
const readStateEvents = readPinsEvent.getContent().event_ids;
|
const readStateEvents = readPinsEvent.getContent().event_ids || [];
|
||||||
if (readStateEvents) {
|
if (readStateEvents) {
|
||||||
return !readStateEvents.includes(currentPinEvent.getId());
|
return !readStateEvents.includes(currentPinEvent.getId());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user