diff --git a/frappe/core/doctype/file/utils.py b/frappe/core/doctype/file/utils.py index 3286704466..b87671b171 100644 --- a/frappe/core/doctype/file/utils.py +++ b/frappe/core/doctype/file/utils.py @@ -238,6 +238,10 @@ def extract_images_from_html(doc: "Document", content: str, is_private: bool = F if b"," in content: content = content.split(b",")[1] + if not content: + # if there is no content, return the original tag + return match.group(0) + try: content = safe_b64decode(content) except BinasciiError: