Merge pull request #57905 from frappe/mergify/bp/version-16-hotfix/pr-57903

fix: condition check with empty object for falsy case (backport #57903)
This commit is contained in:
Mihir Kandoi
2026-08-09 09:44:42 +05:30
committed by GitHub

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