From bcd1005e3c2ef17e8d6b9212a72d238a639ecbfa Mon Sep 17 00:00:00 2001 From: Jaiwanth Date: Wed, 5 May 2021 13:01:14 +0530 Subject: [PATCH] Check truthiness of space --- 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 7c0f8cf59b..d72ee93956 100644 --- a/src/stores/SpaceStore.tsx +++ b/src/stores/SpaceStore.tsx @@ -121,7 +121,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient { */ public async setActiveSpace(space: Room | null, contextSwitch = true) { if (space && !space?.isSpaceRoom()) return; - if (space === this.activeSpace) { + if (space && space === this.activeSpace) { const notificationState = this.getNotificationState(space.roomId); if (notificationState.count) { const roomId = notificationState.getRoomWithMaxNotifications();