From: Bill Erickson Date: Mon, 10 May 2021 15:35:11 +0000 (-0400) Subject: LP1904036 Sanity check missing mailing/billing addresses X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=24e0dca04d89c424b148385d55e3b3bd40d52c69;p=evergreen%2Ftadl.git LP1904036 Sanity check missing mailing/billing addresses Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit-toolbar.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit-toolbar.component.ts index f67751fb0d..a72cf7d68c 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit-toolbar.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit-toolbar.component.ts @@ -87,9 +87,12 @@ export class EditToolbarComponent implements OnInit { checkAddressAlerts(patron: IdlObject, addr: IdlObject) { const addrHash = this.idl.toHash(addr); - console.log('CHECKING ADDR', addrHash); - addrHash.mailing_address = addr.id() === patron.mailing_address().id(); - addrHash.billing_address = addr.id() === patron.billing_address().id(); + if (patron.mailing_address()) { + addrHash.mailing_address = addr.id() === patron.mailing_address().id(); + } + if (patron.billing_address()) { + addrHash.billing_address = addr.id() === patron.billing_address().id(); + } this.net.request( 'open-ils.actor', 'open-ils.actor.address_alert.test', diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html index 2e5f24db13..d916f4e58f 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html @@ -665,7 +665,7 @@
@@ -673,7 +673,7 @@
diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts index 373a6d88cb..1ebfd9d7af 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts @@ -1316,11 +1316,13 @@ export class EditComponent implements OnInit, AfterViewInit { // Roll the mailing/billing designation to another // address when needed. - if (this.patron.mailing_address().id() === addr.id()) { + if (this.patron.mailing_address() && + this.patron.mailing_address().id() === addr.id()) { this.setAddrType('mailing', addr, false); } - if (this.patron.billing_address().id() === addr.id()) { + if (this.patron.billing_address() && + this.patron.billing_address().id() === addr.id()) { this.setAddrType('billing', addr, false); }