8000 fix(router module): safely check parent tagname. fixes #542 (#550) · Sam0930/nativescript-vue@1cc8142 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1cc8142

Browse files
mylmz10rigor789
authored andcommitted
fix(router module): safely check parent tagname. fixes nativescript-vue#542 (nativescript-vue#550)
1 parent 4be5c1f commit 1cc8142

File tree

1 file changed

+5
-1
lines changed
  • platform/nativescript/compiler/modules

1 file changed

+5
-1
lines changed

platform/nativescript/compiler/modules/router.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { addAttr } from 'compiler/helpers'
33

44
function preTransformNode(el) {
55
if (el.tag !== 'router-view') return
6-
if (normalizeElementName(el.parent.tag) === 'nativeframe') {
6+
if (
7+
el.parent &&
8+
el.parent.tag &&
9+
normalizeElementName(el.parent.tag) === 'nativeframe'
10+
) {
711
addAttr(el.parent, 'hasRouterView', 'true')
812
}
913
}

0 commit comments

Comments
 (0)
0