Make sure room does exist before creating vm

- This will stop the code from throwing when opening /details on
  UnknownRoomView.

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-06-24 14:58:02 +05:30
parent a273b25bac
commit eb35f46214

View file

@ -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");