diff --git a/web/libs/datamanager/src/sdk/comments-sdk.js b/web/libs/datamanager/src/sdk/comments-sdk.js index da19dbd04cd7..d0aed12e5c97 100644 --- a/web/libs/datamanager/src/sdk/comments-sdk.js +++ b/web/libs/datamanager/src/sdk/comments-sdk.js @@ -60,6 +60,11 @@ export class CommentsSdk { const res = await this.dm.apiCall("listComments", listParams); + // Ensure request is went through and res is an array + if (!res?.length) { + return []; + } + const commentUsers = []; const comments = res.map((comment) => { commentUsers.push(comment.created_by); diff --git a/web/libs/editor/src/components/SidePanels/OutlinerPanel/OutlinerTree.tsx b/web/libs/editor/src/components/SidePanels/OutlinerPanel/OutlinerTree.tsx index faf99d98a65e..9cbb0612350c 100644 --- a/web/libs/editor/src/components/SidePanels/OutlinerPanel/OutlinerTree.tsx +++ b/web/libs/editor/src/components/SidePanels/OutlinerPanel/OutlinerTree.tsx @@ -154,6 +154,9 @@ const OutlinerInnerTreeComponent: FC = observer(({ regio }, ): void => { const region = regionsTree.find((region: any) => region.key === node.key); + + if (!region) return; + // pos is equal to label name const pos = region.pos; @@ -196,7 +199,7 @@ const OutlinerInnerTreeComponent: FC = observer(({ regio const useDataTree = ({ regions, rootClass, footer }: any) => { const processor = useCallback((item: any, idx, _false, _null, _onClick) => { - const { id, type, hidden, isDrawing } = item ?? {}; + const { id, type, hidden, isDrawing, locked } = item ?? {}; const style = item?.background ?? item?.getOneColor?.(); const color = chroma(style ?? "#666").alpha(1); const mods: Record = { hidden, type, isDrawing }; @@ -218,7 +221,7 @@ const useDataTree = ({ regions, rootClass, footer }: any) => { }, className: rootClass.elem("node").mod(mods).toClassName(), title: (data: any) => , - locked: item.locked, + locked, }; }, []);