diff --git a/extensions/smallrye-metrics/deployment/src/main/java/io/quarkus/smallrye/metrics/deployment/jandex/JandexBeanInfoAdapter.java b/extensions/smallrye-metrics/deployment/src/main/java/io/quarkus/smallrye/metrics/deployment/jandex/JandexBeanInfoAdapter.java index 0b4ff51813a1d..e33ffaf1142a6 100644 --- a/extensions/smallrye-metrics/deployment/src/main/java/io/quarkus/smallrye/metrics/deployment/jandex/JandexBeanInfoAdapter.java +++ b/extensions/smallrye-metrics/deployment/src/main/java/io/quarkus/smallrye/metrics/deployment/jandex/JandexBeanInfoAdapter.java @@ -68,7 +68,7 @@ public BeanInfo convert(ClassInfo input) { private Stream getMetricAnnotationsThroughStereotype(AnnotationInstance stereotypeInstance, IndexView indexView) { ClassInfo annotationType = indexView.getClassByName(stereotypeInstance.name()); - if (annotationType.classAnnotation(DotNames.STEREOTYPE) != null) { + if (annotationType != null && annotationType.declaredAnnotation(DotNames.STEREOTYPE) != null) { JandexAnnotationInfoAdapter adapter = new JandexAnnotationInfoAdapter(indexView); return transformedAnnotations.getAnnotations(annotationType) .stream()