mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-10 21:21:46 +00:00
fix: condition check with empty object for falsy case
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user