mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Fix accessing room prop which is optional (#9523)
Co-authored-by: Michael Weimann <michaelw@matrix.org>
This commit is contained in:
parent
575508ae15
commit
f58d62d339
1 changed files with 3 additions and 2 deletions
|
@ -498,9 +498,10 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
}
|
||||
|
||||
const myUserId = MatrixClientPeg.get().getUserId();
|
||||
const memberEventContent = this.props.room.currentState.getMember(myUserId).events.member.getContent();
|
||||
const member = this.props.room?.currentState.getMember(myUserId);
|
||||
const memberEventContent = member?.events.member?.getContent();
|
||||
|
||||
if (memberEventContent.reason) {
|
||||
if (memberEventContent?.reason) {
|
||||
reasonElement = (
|
||||
<InviteReason
|
||||
reason={memberEventContent.reason}
|
||||
|
|
Loading…
Reference in a new issue