Merge pull request #4133 from matrix-org/t3chguy/pinned
Fix message context menu breaking on invalid m.room.pinned_events event
This commit is contained in:
commit
d5177ddc04
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