fix: condition check with empty object for falsy case

This commit is contained in:
Suhas Bharadwaj
2026-08-06 16:38:46 +05:30
committed by GitHub
parent a49fcfe888
commit e0b9351d49

View File

@@ -456,7 +456,7 @@ const set_employee_and_company = function (frm) {
const options = { user_id: frappe.session.user };
const fields = ["name", "company"];
frappe.db.get_value("Employee", options, fields).then(({ message }) => {
if (message) {
if (message.name && message.company) {
// there is an employee with the currently logged in user_id
frm.set_value("employee", message.name);
frm.set_value("company", message.company);