Check if room is defined
Sometimes it isn't and that leads to errors. We can't use ? here because we also use ! Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
65ef2b845e
commit
f64008e239
1 changed files with 1 additions and 1 deletions
|
@ -498,7 +498,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
|||
|
||||
// We don't want to save if the room is a
|
||||
// space room since it can cause problems
|
||||
if (!room.isSpaceRoom()) {
|
||||
if (room && !room.isSpaceRoom()) {
|
||||
const activeSpaceId = this.activeSpace?.roomId || LAST_VIEWED_ROOMS_HOME;
|
||||
const lastViewedRooms = JSON.parse(window.localStorage.getItem(LAST_VIEWED_ROOMS)) || {};
|
||||
|
||||
|
|
Loading…
Reference in a new issue