From: Bill Erickson Date: Wed, 20 Jan 2021 19:14:36 +0000 (-0500) Subject: LP1929741 Sanity check distrib. formula values X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7f5c83fc90b1e613db93aa350a4a21bad055d8df;p=evergreen%2Fpines.git 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 --- 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();