Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: no childfolder

Marc Seitzac660c38aa36
diff --git a/components/datarooms/edit-dataroom-document-modal.tsx b/components/datarooms/edit-dataroom-document-modal.tsx
index c69ac382..c6208a8d 100644
--- a/components/datarooms/edit-dataroom-document-modal.tsx
+++ b/components/datarooms/edit-dataroom-document-modal.tsx
@@ -49,12 +49,12 @@ function updateDocNameInFolderTree(
folder: DataroomFolderWithDocuments,
): DataroomFolderWithDocuments => ({
...folder,
- documents: folder.documents.map((doc) =>
+ documents: (folder.documents ?? []).map((doc) =>
doc.document.id === docId
? { ...doc, document: { ...doc.document, name: newName } }
: doc,
),
- childFolders: folder.childFolders.map(updateFolder),
+ childFolders: (folder.childFolders ?? []).map(updateFolder),
});
return folders.map(updateFolder);
}