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:
Elian Doran 2024-07-14 09:52:01 +03:00
parent 6ecbf1c528
commit 0792714e45
No known key found for this signature in database

View File

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