From 9d8c6012a251ae7796d2df77609fb9273d55c353 Mon Sep 17 00:00:00 2001 From: google-boy Date: Wed, 13 Sep 2023 12:10:29 +0300 Subject: [PATCH] fix: Check if user has no associated email accounts. (#22355) check that the return array does not exist, is not an array, or is empty http://stackoverflow.com/questions/24403732/ddg#24403771 --- frappe/core/doctype/user/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/user/user.js b/frappe/core/doctype/user/user.js index 7a72918f35..cd89a57dfe 100644 --- a/frappe/core/doctype/user/user.js +++ b/frappe/core/doctype/user/user.js @@ -301,7 +301,7 @@ frappe.ui.form.on("User", { email: frm.doc.email, }, callback: function (r) { - if (!Array.isArray(r.message)) { + if (!Array.isArray(r.message) || !r.message.length) { frappe.route_options = { email_id: frm.doc.email, awaiting_password: 1,