Skip to content

Commit

Permalink
Fix NPE when receiving "external" diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
mickaelistria committed Apr 24, 2024
1 parent 7f504f1 commit 36482ef
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private Optional<CompilationUnit> findTargetDOM(Map<JavaFileObject, CompilationU
return Optional.empty();
}
if (obj instanceof JavaFileObject o) {
return Optional.of(filesToUnits.get(o));
return Optional.ofNullable(filesToUnits.get(o));
}
if (obj instanceof DiagnosticSource source) {
return findTargetDOM(filesToUnits, source.getFile());
Expand Down

0 comments on commit 36482ef

Please sign in to comment.