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

Commit

Permalink
Null guard space hierarchy (#7729)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Feb 7, 2022
1 parent 5d89230 commit 30e80aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/structures/SpaceHierarchy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>;
Expand Down Expand Up @@ -716,7 +716,7 @@ const SpaceHierarchy = ({
return <RovingTabIndexProvider onKeyDown={onKeyDown} handleHomeEnd handleUpDown>
{ ({ onKeyDownHandler }) => {
let content: JSX.Element;
if (loading && !rooms.length) {
if (loading && !rooms?.length) {
content = <Spinner />;
} else {
const hasPermissions = space?.getMyMembership() === "join" &&
Expand Down

0 comments on commit 30e80aa

Please sign in to comment.