From f76ee2ac6c2d0b974cbf607df44e6f81d499e683 Mon Sep 17 00:00:00 2001 From: Chris Thielen Date: Fri, 17 Mar 2017 15:34:42 -0500 Subject: [PATCH] fix(view): Do not throw when uiView doesn't have a state context --- src/view/view.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/view.ts b/src/view/view.ts index de6c028a..385e05ee 100644 --- a/src/view/view.ts +++ b/src/view/view.ts @@ -172,7 +172,7 @@ export class ViewService { // plus the depth of the state that is populating the uiView function uiViewDepth(uiView: ActiveUIView) { const stateDepth = (context: ViewContext) => - context.parent ? stateDepth(context.parent) + 1 : 1; + context && context.parent ? stateDepth(context.parent) + 1 : 1; return (uiView.fqn.split(".").length * 10000) + stateDepth(uiView.creationContext); }