Merge pull request #6830 from matrix-org/t3chguy/fix/npe2

Fix accessing field on oobData which may be undefined
This commit is contained in:
David Baker
2021-09-20 13:38:20 +01:00
committed by GitHub

View File

@@ -323,7 +323,7 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
const messageCase = this.getMessageCase();
switch (messageCase) {
case MessageCase.Joining: {
title = this.props.oobData.roomType === RoomType.Space ? _t("Joining space …") : _t("Joining room …");
title = this.props.oobData?.roomType === RoomType.Space ? _t("Joining space …") : _t("Joining room …");
showSpinner = true;
break;
}