fix: type error for missing frm obj

(cherry picked from commit 20fa3da950)
This commit is contained in:
Gursheen Anand 2024-02-27 11:18:58 +05:30 committed by Mergify
parent 9f8a27833a
commit 6b5e1cfeb7

View File

@ -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]);