From e46d8d6938ccfa6aa01cc2945f6a2b9c85922116 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Sat, 19 Nov 2016 18:15:26 +0100 Subject: [PATCH] fix(modal): backdrop click catches navigation promise A modal with canLeave = false, can lead to an unhandled exception when closing through a click in the backdrop --- src/components/modal/modal-component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/modal/modal-component.ts b/src/components/modal/modal-component.ts index a034ba6d8c..3df20fb76b 100644 --- a/src/components/modal/modal-component.ts +++ b/src/components/modal/modal-component.ts @@ -75,7 +75,9 @@ export class ModalCmp { _bdClick() { if (this._enabled && this._bdDismiss) { - return this._viewCtrl.dismiss(null, 'backdrop'); + return this._viewCtrl.dismiss(null, 'backdrop').catch(() => { + console.debug('Dismiss modal by clicking backdrop was cancelled'); + }); } }