From 5bcba3b388b2e4d8ac350aea50b0a14d6c23e363 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Thu, 2 May 2019 22:22:58 +0200 Subject: [PATCH] Fix NPE on pattern check --- src/compile/nodes/EachBlock.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile/nodes/EachBlock.ts b/src/compile/nodes/EachBlock.ts index 74a58fff38..2842ba684f 100644 --- a/src/compile/nodes/EachBlock.ts +++ b/src/compile/nodes/EachBlock.ts @@ -16,7 +16,7 @@ function unpack_destructuring(contexts: Array<{ name: string, tail: string }>, n }); } else if (node.type === 'ArrayPattern') { node.elements.forEach((element, i) => { - if (element.type === 'RestIdentifier') { + if (element && element.type === 'RestIdentifier') { unpack_destructuring(contexts, element, `${tail}.slice(${i})`) } else { unpack_destructuring(contexts, element, `${tail}[${i}]`);