diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index 456a215f10b7..640b5225ff4a 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -27,7 +27,7 @@ $.extend(erpnext, { }, hide_company: function() { - if(cur_frm.fields_dict.company) { + if(cur_frm?.fields_dict.company) { var companies = Object.keys(locals[":Company"] || {}); if(companies.length === 1) { if(!cur_frm.doc.company) cur_frm.set_value("company", companies[0]);