diff --git a/lib/linter/code-path-analysis/code-path-analyzer.js b/lib/linter/code-path-analysis/code-path-analyzer.js index 8a623e33ea06..0ad66f9e6ef6 100644 --- a/lib/linter/code-path-analysis/code-path-analyzer.js +++ b/lib/linter/code-path-analysis/code-path-analyzer.js @@ -153,6 +153,10 @@ function isIdentifierReference(node) { */ function forwardCurrentToHead(analyzer, node) { const codePath = analyzer.codePath; + + if (!codePath) { + return; + } const state = CodePath.getState(codePath); const currentSegments = state.currentSegments; const headSegments = state.headSegments;