@samitouri / QOSami-HFS / commits / 359bb820

fix: "internal server error" on folders where you removed all children in the VFS

Massimo Melina committed Jan 3, 2024 at 14:56 UTC 359bb820ca1de1fca62f843e057d1f8a11f93f8e
1 file changed +1 -1
src/vfs.ts
+1 -1
@@ -72,7 +72,7 @@ export async function applyParentToChild(child: VfsNode | undefined, parent: Vfs
72 const ret: VfsNode = {
73 original: child, // leave it possible for child to override this
74 ...child,
75 - isFolder: child?.isFolder ?? (!child?.children ? undefined : child?.children.length > 0), // isFolder is hidden in original node, so we must read it to copy it
75 + isFolder: child?.isFolder ?? (child?.children?.length! > 0 || undefined), // isFolder is hidden in original node, so we must read it to copy it
76 isTemp: true,
77 parent,
78 }