fix: couldn't create 2 virtual folders #146

Massimo Melina committed Mar 12, 2023 at 10:44 UTC 0311d33bf71705f0f4d3248f34f874b6c38f4287
1 file changed +1 -1
src/api.vfs.ts
+1 -1
@@ -105,7 +105,7 @@ const apis: ApiHandlers = {
105 if (isWindowsDrive(source))
106 source += '\\' // slash must be included, otherwise it will refer to the cwd of that drive
107 n.children ||= []
108 - if (n.children.find(x => x.source === source || getNodeName(x) === name))
108 + if (n.children.find(x => source && source === x.source || getNodeName(x) === name))
109 return new ApiError(HTTP_CONFLICT, 'already present')
110 n.children.unshift({ source, name })
111 await saveVfs()