Skip to content

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

fix: make router query optional

Marc Seitz6ba24dfa6d90
diff --git a/components/sidebar-folders.tsx b/components/sidebar-folders.tsx
index 63de9bc4..d2900963 100644
--- a/components/sidebar-folders.tsx
+++ b/components/sidebar-folders.tsx
@@ -55,7 +55,7 @@ const FolderComponent = memo(({ folder }: { folder: FolderWithDocuments }) => {
<FileTree.Folder
name={folder.name}
key={folder.id}
- active={folder.path === "/" + (router.query.name as string[]).join("/")}
+ active={folder.path === "/" + (router.query.name as string[])?.join("/")}
childActive={router.query.name?.includes(folder.name)}
onToggle={() => router.push(`/documents/tree${folder.path}`)}
>