Skip to content

Commit

Permalink
Add a null-check to work around #3484
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 481216285
  • Loading branch information
cushon authored and Error Prone Team committed Oct 14, 2022
1 parent 85dc702 commit db6459d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ static <T> T makeMatcher(Class<T> klass) {

static VisitorState makeVisitorState(Tree target, Unifier unifier) {
Context context = unifier.getContext();
VisitorState state = new VisitorState(context);
TreePath path = TreePath.getPath(context.get(JCCompilationUnit.class), target);
return new VisitorState(context).withPath(path);
if (path != null) {
state = state.withPath(path);
}
return state;
}
}

0 comments on commit db6459d

Please sign in to comment.