diff --git a/src/frontend/src/components/folderSidebarComponent/components/sideBarFolderButtons/index.tsx b/src/frontend/src/components/folderSidebarComponent/components/sideBarFolderButtons/index.tsx index 5c478082897..49b7d7d4c43 100644 --- a/src/frontend/src/components/folderSidebarComponent/components/sideBarFolderButtons/index.tsx +++ b/src/frontend/src/components/folderSidebarComponent/components/sideBarFolderButtons/index.tsx @@ -156,7 +156,11 @@ const SideBarFoldersButtonsComponent = ({ } useEffect(() => { - setEditFolderName(folders.map((obj) => ({ name: obj.name, edit: false }))); + if (folders && folders.length > 0) { + setEditFolderName( + folders.map((obj) => ({ name: obj.name, edit: false })), + ); + } }, [folders]); const handleEditNameFolder = async (item) => {