core: don't return invalid dataurl if image doesn't exist

This commit is contained in:
Abdullah Atta
2023-03-22 09:38:02 +05:00
committed by Abdullah Atta
parent e43740c6bc
commit bc433c56ae

View File

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