From 9cd80cbfe81954b79ea23a8923ff14de702dccff Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Wed, 1 Jun 2016 22:19:09 -0500 Subject: [PATCH] chore(nav): add promise rejects to popTo --- src/components/nav/nav-controller.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/nav/nav-controller.ts b/src/components/nav/nav-controller.ts index 1cde1f0820..61b391bfca 100644 --- a/src/components/nav/nav-controller.ts +++ b/src/components/nav/nav-controller.ts @@ -745,6 +745,10 @@ export class NavController extends Ion { */ popTo(view: ViewController, opts?: NavOptions): Promise { let startIndex = this.indexOf(view); + if (startIndex < 0) { + return Promise.reject('View not found to pop to'); + } + let activeView = this.getByState(STATE_TRANS_ENTER) || this.getByState(STATE_INIT_ENTER) || this.getActive();