Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 30e80aa

Browse files
authored
Null guard space hierarchy (#7729)
1 parent 5d89230 commit 30e80aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/structures/SpaceHierarchy.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ const INITIAL_PAGE_SIZE = 20;
475475

476476
export const useRoomHierarchy = (space: Room): {
477477
loading: boolean;
478-
rooms: IHierarchyRoom[];
478+
rooms?: IHierarchyRoom[];
479479
hierarchy: RoomHierarchy;
480480
error: Error;
481481
loadMore(pageSize?: number): Promise<void>;
@@ -716,7 +716,7 @@ const SpaceHierarchy = ({
716716
return <RovingTabIndexProvider onKeyDown={onKeyDown} handleHomeEnd handleUpDown>
717717
{ ({ onKeyDownHandler }) => {
718718
let content: JSX.Element;
719-
if (loading && !rooms.length) {
719+
if (loading && !rooms?.length) {
720720
content = <Spinner />;
721721
} else {
722722
const hasPermissions = space?.getMyMembership() === "join" &&

0 commit comments

Comments
 (0)