Skip to content

Build your personal knowledge base with Trilium Notes

server: Fix regression in uploading images

Elian Doran0792714e4583
diff --git a/src/becca/entities/bnote.ts b/src/becca/entities/bnote.ts
index a007f5278c..16461c35fb 100644
--- a/src/becca/entities/bnote.ts
+++ b/src/becca/entities/bnote.ts
@@ -1644,10 +1644,7 @@ class BNote extends AbstractBeccaEntity<BNote> {
position
});
- if (!content) {
- throw new Error("Attempted to save an attachment with no content.");
- }
-
+ content = content || "";
attachment.setContent(content, {forceSave: true});
return attachment;