Skip to content

Commit

Permalink
Merge pull request #115 from gastaldi/npe_check
Browse files Browse the repository at this point in the history
Fixes potential NPE while reading annotations
  • Loading branch information
jamezp authored Jul 3, 2024
2 parents e58849e + 28b1f32 commit 0dca8ee
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 0dca8ee

Please sign in to comment.