fix: NotionImportTask

This commit is contained in:
Tom Moor
2023-03-29 09:34:04 -04:00
parent 8a2831ef80
commit 794df52080
2 changed files with 2 additions and 2 deletions

View File

@@ -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,
});

View File

@@ -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);
}