Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(import/enex): "Missing or wrong content type for resource" (fixes #943)
Elian Doran24c02e013b95
diff --git a/src/services/import/enex.ts b/src/services/import/enex.tsindex 9ac0641094..ae248ab753 100644--- a/src/services/import/enex.ts+++ b/src/services/import/enex.ts@@ -315,14 +315,10 @@ function importEnex(taskContext: TaskContext, file: File, parentNote: BNote): Prresource.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()