Skip to content

Commit

Permalink
Fixes potential NPE while reading annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Jul 3, 2024
1 parent 07aa37b commit 28b1f32
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ public Set<Parameter> parameters() {
@Override
public Set<Parameter> parametersAnnotatedWith(final Class<? extends Annotation> annotation) {
final TypeElement type = ElementHelper.toTypeElement(elements, annotation);
return parameters.containsKey(type.asType()) ? Collections.unmodifiableSet(parameters.get(type.asType()))
return (type != null && parameters.containsKey(type.asType()))
? Collections.unmodifiableSet(parameters.get(type.asType()))
: Collections.emptySet();
}

Expand Down

0 comments on commit 28b1f32

Please sign in to comment.