From b8407da1c9a5927e08caab11a5ca25c55e0d904a Mon Sep 17 00:00:00 2001 From: mylmz10 Date: Wed, 11 Sep 2019 09:59:35 +0300 Subject: [PATCH] fix(router module): check the el.parent has tag property on router fix #542 --- platform/nativescript/compiler/modules/router.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/nativescript/compiler/modules/router.js b/platform/nativescript/compiler/modules/router.js index fcf9f414..d6d801d1 100644 --- a/platform/nativescript/compiler/modules/router.js +++ b/platform/nativescript/compiler/modules/router.js @@ -3,7 +3,11 @@ import { addAttr } from 'compiler/helpers' function preTransformNode(el) { if (el.tag !== 'router-view') return - if (normalizeElementName(el.parent.tag) === 'nativeframe') { + if ( + el.parent && + el.parent.tag && + normalizeElementName(el.parent.tag) === 'nativeframe' + ) { addAttr(el.parent, 'hasRouterView', 'true') } }