Skip to content

Commit

Permalink
fix: frappe.get_palette when text is undefined (#21033)
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
rmehta committed May 17, 2023
1 parent badcd7a commit 44e592f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions frappe/public/js/frappe/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ frappe.palette = [
];

frappe.get_palette = function (txt) {
if (!txt) return frappe.palette[8]; // breaks when undefined
var idx = cint((parseInt(md5(txt).substr(4, 2), 16) + 1) / 5.33);
return frappe.palette[idx % 8];
};
Expand Down

0 comments on commit 44e592f

Please sign in to comment.