fix(router): doen't throw on canDeactive when route hasn't advanced

This commit is contained in:
vsavkin 2016-06-24 11:39:12 -07:00
parent dcf75126bf
commit 41b781107b
1 changed files with 1 additions and 1 deletions

View File

@ -460,7 +460,7 @@ class GuardChecks {
}
private runCanDeactivate(component: Object, curr: ActivatedRouteSnapshot): Observable<boolean> {
const canDeactivate = curr._routeConfig ? curr._routeConfig.canDeactivate : null;
const canDeactivate = curr && curr._routeConfig ? curr._routeConfig.canDeactivate : null;
if (!canDeactivate || canDeactivate.length === 0) return of (true);
return Observable.from(canDeactivate)
.map(c => {