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
This commit is contained in:
google-boy 2023-09-13 12:10:29 +03:00 committed by GitHub
parent 970a740164
commit 9d8c6012a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,