From 6ccee750e3aa4ae0d472afc7ee35204a88e5b700 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 2 Nov 2015 06:42:48 +0000 Subject: [PATCH] check for path existence before checking that it's the correct instance --- packages/babel-traverse/src/path/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-traverse/src/path/index.js b/packages/babel-traverse/src/path/index.js index 39a0e26348..4732638ec6 100644 --- a/packages/babel-traverse/src/path/index.js +++ b/packages/babel-traverse/src/path/index.js @@ -77,7 +77,7 @@ export default class NodePath { } } - if (!(path instanceof NodePath)) { + if (path && !(path instanceof NodePath)) { if (path.constructor.name === "NodePath") { // we're going to absolutley thrash the tree and allocate way too many node paths // than is necessary but there's no way around this as the node module resolution