From 1b2f111e919118699994040c1a9925a7cbc9d597 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 14 Jun 2021 15:55:29 -0400 Subject: [PATCH] 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 --- Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 { -- 2.11.0