From 20fa3da950f3834cac812c9702284c470fb19af2 Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Tue, 27 Feb 2024 11:18:58 +0530 Subject: [PATCH] fix: type error for missing frm obj --- erpnext/public/js/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index aee761f5d2..89773ad812 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]);