fix: Don't check PDF content if not defined (#33914)

This commit is contained in:
Corentin Forler 2025-09-09 11:59:57 +02:00 committed by GitHub
parent bdcd7c8eed
commit 64aa4787be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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):