From 86bbaa365e89fe73e2f24229d01218dd8d77a0b7 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 20 Jan 2021 15:47:03 -0500 Subject: [PATCH] LP1929741 Combobox additional sanity checks on async/IDL values 1. Avoid PCRUD queries where the selected id value is set to null. 2. Avoid attempts to add null entries to the async entry cache. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts | 6 +++++- 1 file changed, 5 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 da4ad68b5d..5c70ced2ee 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 @@ -121,7 +121,10 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie if (id === undefined) { return; } // clear on explicit null - if (id === null) { this.selected = null; } + if (id === null) { + this.selected = null; + return; + } if (this.entrylist.length) { this.selected = this.entrylist.filter(e => e.id === id)[0]; @@ -433,6 +436,7 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie } addAsyncEntry(entry: ComboboxEntry) { + if (!entry) { return; } // Avoid duplicate async entries if (!this.asyncIds['' + entry.id]) { this.asyncIds['' + entry.id] = true; -- 2.11.0