From 0792714e458323f7e03950583b1181c1e917d7ec Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 14 Jul 2024 09:52:01 +0300 Subject: [PATCH] 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. --- src/becca/entities/bnote.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/becca/entities/bnote.ts b/src/becca/entities/bnote.ts index a007f5278..16461c35f 100644 --- a/src/becca/entities/bnote.ts +++ b/src/becca/entities/bnote.ts @@ -1644,10 +1644,7 @@ class BNote extends AbstractBeccaEntity { position }); - if (!content) { - throw new Error("Attempted to save an attachment with no content."); - } - + content = content || ""; attachment.setContent(content, {forceSave: true}); return attachment;