Skip to content

Commit

Permalink
Cope with missing annotation parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur McGibbon committed Apr 5, 2024
1 parent 545506a commit 4f62b19
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ public Semanticdb.AnnotationTree annotationBuilder(AnnotationTree annotation) {
AssignmentTree assign = (AssignmentTree) param;
ExpressionTree assignValue = assign.getExpression();
TreePath variableTreePath = nodes.get(assign.getVariable());
Element variableSym = trees.getElement(variableTreePath);
String symbol = globals.semanticdbSymbol(variableSym, locals);
params.add(tree(assignTree(tree(idTree(symbol)), annotationParameter(assignValue))));
if (variableTreePath != null) {
Element variableSym = trees.getElement(variableTreePath);
String symbol = globals.semanticdbSymbol(variableSym, locals);
params.add(tree(assignTree(tree(idTree(symbol)), annotationParameter(assignValue))));
}
} else {
params.add(annotationParameter(param));
}
Expand Down

0 comments on commit 4f62b19

Please sign in to comment.