mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-04 19:56:45 +02:00
null-guard space store getParents relation lookup (#7029)
This commit is contained in:
parent
be0fa6da7b
commit
92df0a35a9
@ -315,7 +315,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
||||
// child relations, as per MSC1772.
|
||||
// https://github.com/matrix-org/matrix-doc/blob/main/proposals/1772-groups-as-rooms.md#relationship-between-rooms-and-spaces
|
||||
const parent = this.matrixClient.getRoom(ev.getStateKey());
|
||||
const relation = parent.currentState.getStateEvents(EventType.SpaceChild, roomId);
|
||||
const relation = parent?.currentState.getStateEvents(EventType.SpaceChild, roomId);
|
||||
if (!parent?.currentState.maySendStateEvent(EventType.SpaceChild, userId) ||
|
||||
// also skip this relation if the parent had this child added but then since removed it
|
||||
(relation && !Array.isArray(relation.getContent().via))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user