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