From eb35f462141c9abb363a6618580bc4d8039911e4 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Thu, 24 Jun 2021 14:58:02 +0530 Subject: [PATCH] Make sure room does exist before creating vm - This will stop the code from throwing when opening /details on UnknownRoomView. Signed-off-by: RMidhunSuresh --- src/domain/session/SessionViewModel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/domain/session/SessionViewModel.js b/src/domain/session/SessionViewModel.js index 14bb087e..087b9315 100644 --- a/src/domain/session/SessionViewModel.js +++ b/src/domain/session/SessionViewModel.js @@ -261,6 +261,7 @@ export class SessionViewModel extends ViewModel { const enable = !!this.navigation.path.get("details")?.value; if (enable) { const room = this._roomFromNavigation(); + if (!room) { return; } this._roomDetailsViewModel = this.track(new RoomDetailsViewModel(this.childOptions({room}))); } this.emitChange("roomDetailsViewModel");