diff --git a/src/components/structures/SpaceHierarchy.tsx b/src/components/structures/SpaceHierarchy.tsx index 14bfbfbfa3a..92ab8d80c66 100644 --- a/src/components/structures/SpaceHierarchy.tsx +++ b/src/components/structures/SpaceHierarchy.tsx @@ -475,7 +475,7 @@ const INITIAL_PAGE_SIZE = 20; export const useRoomHierarchy = (space: Room): { loading: boolean; - rooms: IHierarchyRoom[]; + rooms?: IHierarchyRoom[]; hierarchy: RoomHierarchy; error: Error; loadMore(pageSize?: number): Promise; @@ -716,7 +716,7 @@ const SpaceHierarchy = ({ return { ({ onKeyDownHandler }) => { let content: JSX.Element; - if (loading && !rooms.length) { + if (loading && !rooms?.length) { content = ; } else { const hasPermissions = space?.getMyMembership() === "join" &&