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 <berickxx@gmail.com>
this.modalRef = null;
},
(result) => {
- console.log('dialog closed with ' + result);
+ console.debug('dialog closed with ' + result);
reject(result);
this.modalRef = null;
}
}
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);
+ }
}
}