From bc433c56aebd4528bc405e43627ea4c5cb7ced4b Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Wed, 22 Mar 2023 09:38:02 +0500 Subject: [PATCH] core: don't return invalid dataurl if image doesn't exist --- packages/core/collections/attachments.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/collections/attachments.js b/packages/core/collections/attachments.js index 311c12450..0e59f8782 100644 --- a/packages/core/collections/attachments.js +++ b/packages/core/collections/attachments.js @@ -250,6 +250,8 @@ export default class Attachments extends Collection { outputType } ); + if (!data) return; + return outputType === "base64" ? dataurl.fromObject({ type: attachment.metadata.type, data }) : data;