Fix message context menu breaking on invalid m.room.pinned_events event
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
2bd32050fc
commit
9a1236a016
1 changed files with 2 additions and 1 deletions
|
@ -90,7 +90,8 @@ export default createReactClass({
|
||||||
const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
|
const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
|
||||||
const pinnedEvent = room.currentState.getStateEvents('m.room.pinned_events', '');
|
const pinnedEvent = room.currentState.getStateEvents('m.room.pinned_events', '');
|
||||||
if (!pinnedEvent) return false;
|
if (!pinnedEvent) return false;
|
||||||
return pinnedEvent.getContent().pinned.includes(this.props.mxEvent.getId());
|
const content = pinnedEvent.getContent();
|
||||||
|
return content.pinned && Array.isArray(content.pinned) && content.pinned.includes(this.props.mxEvent.getId());
|
||||||
},
|
},
|
||||||
|
|
||||||
onResendClick: function() {
|
onResendClick: function() {
|
||||||
|
|
Loading…
Reference in a new issue