Fix some NPEs

pull/21833/head
Michael Telatynski 2021-06-16 09:07:55 +01:00
parent b4fbc791bb
commit a75fb98fbc
2 changed files with 2 additions and 1 deletions

View File

@ -262,7 +262,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
if (!space && SettingsStore.getValue("feature_spaces.all_rooms")) { if (!space && SettingsStore.getValue("feature_spaces.all_rooms")) {
return new Set(this.matrixClient.getVisibleRooms().map(r => r.roomId)); return new Set(this.matrixClient.getVisibleRooms().map(r => r.roomId));
} }
return this.spaceFilteredRooms.get(space.roomId) || new Set(); return this.spaceFilteredRooms.get(space?.roomId || HOME_SPACE) || new Set();
}; };
private rebuild = throttle(() => { private rebuild = throttle(() => {

View File

@ -30,6 +30,7 @@ export class SpaceWatcher {
constructor(private store: RoomListStoreClass) { constructor(private store: RoomListStoreClass) {
if (!SettingsStore.getValue("feature_spaces.all_rooms")) { if (!SettingsStore.getValue("feature_spaces.all_rooms")) {
this.filter = new SpaceFilterCondition();
this.updateFilter(); this.updateFilter();
store.addFilter(this.filter); store.addFilter(this.filter);
} }