From: Galen Charlton Date: Tue, 14 Dec 2021 16:09:29 +0000 (-0500) Subject: LP#1942220: fix glitch in direct charges deletion testing X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1e0d63ec82c23f7d0c077ad03c40fac474a1d14a;p=working%2FEvergreen.git LP#1942220: fix glitch in direct charges deletion testing Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts index 21464f993c..d38f54b802 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts @@ -122,12 +122,12 @@ export class PoChargesComponent implements OnInit, OnDestroy { if (debit && debit.encumbrance() === 'f') { return false; // if it's expended, we can't just delete it } - if (debit.invoice_entry()) { + if (debit && debit.invoice_entry()) { return false; // we shouldn't actually be a po_item that is // linked to an invoice_entry, but if we are, // do NOT touch } - if (debit.invoice_items() && debit.invoice_items().length) { + if (debit && debit.invoice_items() && debit.invoice_items().length) { return false; // we're linked to an invoice item, so the disposition of the // invoice entry should govern things }