Skip to content

Commit

Permalink
fix: frappe.get_palette when text is undefined (frappe#21033) (frappe…
Browse files Browse the repository at this point in the history
…#21034)

[skip ci]

(cherry picked from commit 44e592f)

Co-authored-by: Rushabh Mehta <rmehta@gmail.com>
  • Loading branch information
mergify[bot] and rmehta committed May 17, 2023
1 parent 723ec9a commit 1557d68
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 @@ -129,6 +129,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 1557d68

Please sign in to comment.