fix(import/enex): "Missing or wrong content type for resource" (fixes #943)

This commit is contained in:
Elian Doran 2025-02-23 19:58:43 +02:00
parent d319eede1f
commit 24c02e013b
No known key found for this signature in database

View File

@ -315,14 +315,10 @@ function importEnex(taskContext: TaskContext, file: File, parentNote: BNote): Pr
resource.mime = resource.mime || "application/octet-stream";
const createFileNote = () => {
if (typeof resource.content !== "string") {
throw new Error("Missing or wrong content type for resource.");
}
const resourceNote = noteService.createNewNote({
parentNoteId: noteEntity.noteId,
title: resource.title,
content: resource.content,
content: resource.content ?? "",
type: "file",
mime: resource.mime,
isProtected: parentNote.isProtected && protectedSessionService.isProtectedSessionAvailable()