From 07a952a1bbca35fcd57e130d45ddc5e45d13fde6 Mon Sep 17 00:00:00 2001 From: Jaiwanth Date: Tue, 11 May 2021 11:01:28 +0530 Subject: [PATCH] Update src/stores/SpaceStore.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Šimon Brandner --- src/stores/SpaceStore.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx index d906157435..2f52061783 100644 --- a/src/stores/SpaceStore.tsx +++ b/src/stores/SpaceStore.tsx @@ -120,7 +120,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient { * should not be done when the space switch is done implicitly due to another event like switching room. */ public async setActiveSpace(space: Room | null, contextSwitch = true) { - if (!space?.isSpaceRoom()) return; + if (space && !space.isSpaceRoom()) return; if (space === this.activeSpace) { const notificationState = this.getNotificationState(space ? space.roomId : HOME_SPACE); if (notificationState.count) {