mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 17:55:52 +01:00
server: Fix regression in uploading images
The attachment is first saved with no content while the image is being asynchronously resized. On our side we had a guard condition fail if the content was empty, whereas the original implementation was simply using an empty string instead.
This commit is contained in:
@@ -1644,10 +1644,7 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
position
|
position
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!content) {
|
content = content || "";
|
||||||
throw new Error("Attempted to save an attachment with no content.");
|
|
||||||
}
|
|
||||||
|
|
||||||
attachment.setContent(content, {forceSave: true});
|
attachment.setContent(content, {forceSave: true});
|
||||||
|
|
||||||
return attachment;
|
return attachment;
|
||||||
|
|||||||
Reference in New Issue
Block a user