diff --git a/server/queues/tasks/ImportNotionTask.ts b/server/queues/tasks/ImportNotionTask.ts index 1f163c90e..dfb099eb3 100644 --- a/server/queues/tasks/ImportNotionTask.ts +++ b/server/queues/tasks/ImportNotionTask.ts @@ -88,7 +88,7 @@ export default class ImportNotionTask extends ImportTask { const { title, text } = await documentImporter({ mimeType: mimeType || "text/markdown", fileName: name, - content: await zipObject.async("string"), + content: zipObject ? await zipObject.async("string") : "", user, ip: user.lastActiveIp || undefined, }); diff --git a/server/utils/ZipHelper.ts b/server/utils/ZipHelper.ts index 424efaaeb..f8bf3e95d 100644 --- a/server/utils/ZipHelper.ts +++ b/server/utils/ZipHelper.ts @@ -127,7 +127,7 @@ export default class ZipHelper { // "zip.files" for ZIPs created on Windows does not return paths for // directories, so we must add them manually if missing. const dir = filePath.slice(0, filePath.lastIndexOf("/") + 1); - if (!paths.includes(dir)) { + if (dir.length > 1 && !paths.includes(dir)) { paths.push(dir); }