From 209cd304d90e9dc774023fbc776f91425fb06945 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 20 Sep 2021 12:40:22 +0100 Subject: [PATCH] Fix crash on joining rooms https://github.com/matrix-org/matrix-react-sdk/pull/6818 passed roomType in obbData & then used oobData without null checking, but we don't always have oobData so joining a room from /join or from an invite would crash. Type: defect --- src/components/views/rooms/RoomPreviewBar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomPreviewBar.tsx b/src/components/views/rooms/RoomPreviewBar.tsx index 30d634e428f..2acefc93d62 100644 --- a/src/components/views/rooms/RoomPreviewBar.tsx +++ b/src/components/views/rooms/RoomPreviewBar.tsx @@ -323,7 +323,7 @@ export default class RoomPreviewBar extends React.Component { 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; }