diff --git a/frappe/core/doctype/file/file.js b/frappe/core/doctype/file/file.js index 62298fe809..6d77cb91ad 100644 --- a/frappe/core/doctype/file/file.js +++ b/frappe/core/doctype/file/file.js @@ -23,7 +23,7 @@ frappe.ui.form.on("File", "refresh", function(frm) { wrapper.empty(); } - if(frm.doc.file_name.split('.').splice(-1)[0]==='zip') { + if(frm.doc.file_name && frm.doc.file_name.split('.').splice(-1)[0]==='zip') { frm.add_custom_button(__('Unzip'), function() { frappe.call({ method: "frappe.core.doctype.file.file.unzip_file",