From 30e80aa87d9966f83d97856b08686415ad03f46d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 7 Feb 2022 13:48:35 +0000 Subject: [PATCH] Null guard space hierarchy (#7729) --- src/components/structures/SpaceHierarchy.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/SpaceHierarchy.tsx b/src/components/structures/SpaceHierarchy.tsx index 14bfbfbfa3..92ab8d80c6 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" &&