Skip to content
Permalink
Browse files
Fix NPE in static analysis on re-including empty files
Fix a NullPointerException that occurs in static analysis when a file is included after an empty file has been dynamically included.
Fixes #1221.
  • Loading branch information
Pieter12345 committed Jul 15, 2020
1 parent 1789f79 commit e83eed226687109bbd25d8b352bf02399eb96bcc
Showing 1 changed file with 3 additions and 1 deletion.
@@ -335,7 +335,9 @@ public void analyzeFinalScopeGraph(Environment env, Set<ConfigCompileException>

private void typecheck(Environment env, Set<ConfigCompileException> exceptions) {
for(StaticAnalysis analysis : this.staticAnalyses) {
analysis.typecheck(analysis.astRootNode, env, exceptions);
if(analysis.astRootNode != null) { // This is null for empty files, since those are not analyzed.
analysis.typecheck(analysis.astRootNode, env, exceptions);
}
}
}

0 comments on commit e83eed2

Please sign in to comment.