From 659192c0166904cb85839fa4ba758e08f34352af Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 11 Jul 2018 14:55:55 -0400 Subject: [PATCH] LP#1775466 Dialog robustification In certain circumstances, the close() operation can be called after the dismiss() operation (blur action maybe?) which tries to invoke a method on a now-null reference. Avoid said invocation. Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts b/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts index 8a93ea6e01..3ffd5db069 100644 --- a/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts @@ -56,7 +56,7 @@ export class DialogComponent implements OnInit { this.modalRef = null; }, (result) => { - console.log('dialog closed with ' + result); + console.debug('dialog closed with ' + result); reject(result); this.modalRef = null; } @@ -65,11 +65,15 @@ export class DialogComponent implements OnInit { } close(reason?: any): void { - this.modalRef.close(reason); + if (this.modalRef) { + this.modalRef.close(reason); + } } dismiss(reason?: any): void { - this.modalRef.dismiss(reason); + if (this.modalRef) { + this.modalRef.dismiss(reason); + } } } -- 2.11.0