Don't catch NPE in AnnotatedElementAccessor

NPE is thrown when the annotation class param is null
This commit is contained in:
Jason Penilla 2021-09-27 15:17:32 -07:00 committed by Jason
parent c9725ed763
commit 9e39b0ca8e

View file

@ -45,11 +45,7 @@ final class AnnotatedElementAccessor implements AnnotationAccessor {
public <A extends Annotation> @Nullable A annotation(
final @NonNull Class<A> clazz
) {
try {
return this.element.getAnnotation(clazz);
} catch (final NullPointerException exception) {
return null;
}
return this.element.getAnnotation(clazz);
}
@Override