From 3ee508e649384e50a58e4a0c36fbd0c1e02827b2 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 12 Feb 2019 18:26:59 +0100 Subject: [PATCH] fix(): verify node is defined before checking its validity Fixes bug when using conditional nodes, e.g. `{variableSet && }` --- src/stencil-helmet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stencil-helmet.ts b/src/stencil-helmet.ts index df740b7..f81f7f0 100644 --- a/src/stencil-helmet.ts +++ b/src/stencil-helmet.ts @@ -7,7 +7,7 @@ const headExists = document && document.head; const validTagNames = Object.keys(render); const isValidNode = (node: VNode) => - validTagNames.indexOf(node.vtag as string) > -1; + node && validTagNames.indexOf(node.vtag as string) > -1; const renderNode = (node: VNode) => render[node.vtag](node, document.head);