From e0b9351d492bdf5cf009690ea86b2fbed295fcbc Mon Sep 17 00:00:00 2001 From: Suhas Bharadwaj Date: Thu, 6 Aug 2026 16:38:46 +0530 Subject: [PATCH] fix: condition check with empty object for falsy case --- erpnext/projects/doctype/timesheet/timesheet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js index bc63ba79a80..3408c8f1843 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.js +++ b/erpnext/projects/doctype/timesheet/timesheet.js @@ -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);