From 7f5c83fc90b1e613db93aa350a4a21bad055d8df Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 20 Jan 2021 14:14:36 -0500 Subject: [PATCH] LP1929741 Sanity check distrib. formula values No fields within a distribution formula are required, so confirm a set of values exists before calling Object.keys() on an undefined value. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton Signed-off-by: Jane Sandberg --- .../src/eg2/src/app/staff/acq/lineitem/copies.component.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copies.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copies.component.ts index efc64c6dd1..3ad72df237 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copies.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copies.component.ts @@ -171,9 +171,14 @@ export class LineitemCopiesComponent implements OnInit, AfterViewInit { // are not required to go fetch them en masse / en duplicato. fetchFormulaValues(): Promise { - const funds = Object.keys(this.formulaValues.fund); - const mods = Object.keys(this.formulaValues.circ_modifier); - const locs = Object.keys(this.formulaValues.location); + const funds = this.formulaValues.fund ? + Object.keys(this.formulaValues.fund) : []; + + const mods = this.formulaValues.circ_modifier ? + Object.keys(this.formulaValues.circ_modifier) : []; + + const locs = this.formulaValues.location ? + Object.keys(this.formulaValues.location) : []; let promise = Promise.resolve(); -- 2.11.0