From 64aa4787beef2a2834f71619a968239ea4c4e5e8 Mon Sep 17 00:00:00 2001 From: Corentin Forler <10946971+cogk@users.noreply.github.com> Date: Tue, 9 Sep 2025 11:59:57 +0200 Subject: [PATCH] fix: Don't check PDF content if not defined (#33914) --- frappe/core/doctype/file/file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/file/file.py b/frappe/core/doctype/file/file.py index e5a9f86c8b..1d0b3ab2f3 100755 --- a/frappe/core/doctype/file/file.py +++ b/frappe/core/doctype/file/file.py @@ -390,7 +390,7 @@ class File(Document): ) def check_content(self): - if self.file_type == "PDF" and not pdf_contains_js(self._content): + if self.file_type == "PDF" and self._content and not pdf_contains_js(self._content): frappe.throw(_("PDF cannot be uploaded, It contains unsafe content")) def validate_duplicate_entry(self):