fix: check score in response to set strength indicator (#31384)

This commit is contained in:
Abdeali Chharchhodawala 2025-02-24 15:18:44 +05:30 committed by GitHub
parent 39b8e31c5a
commit e38d60b5ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,10 +75,9 @@ frappe.ui.form.ControlPassword = class ControlPassword extends frappe.ui.form.Co
new_password: value || "",
},
callback: function (r) {
if (r.message) {
let score = r.message.score;
var indicators = ["red", "red", "orange", "blue", "green"];
me.set_strength_indicator(indicators[score]);
if (r.message.score !== undefined && r.message.score !== null) {
const indicators = ["red", "red", "orange", "blue", "green"];
me.set_strength_indicator(indicators[r.message.score]);
}
},
});