From: Bill Erickson Date: Mon, 14 Jun 2021 19:55:29 +0000 (-0400) Subject: LP1928258 Combobox sanity checks X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1b2f111e919118699994040c1a9925a7cbc9d597;p=working%2FEvergreen.git LP1928258 Combobox sanity checks Avoid failures caused by calling toLowerCase() on a number. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts index 50cc70f10f..1385756ced 100644 --- a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts +++ b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts @@ -573,7 +573,9 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie // Filter entrylist whose labels substring-match the // text entered. return this.entrylist.filter(entry => { - const label = entry.label || entry.id; + const label = String(entry.label) || String(entry.id); + if (!label) { return false; } + if (this.startsWith) { return label.toLowerCase().startsWith(term.toLowerCase()); } else {