Skip to content

Commit

Permalink
Metrics - check if index contains class before attempting to use it
Browse files Browse the repository at this point in the history
(cherry picked from commit 3cb61b7)
  • Loading branch information
manovotn authored and gsmet committed Feb 8, 2023
1 parent 3ed1369 commit 0df8368
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public BeanInfo convert(ClassInfo input) {
private Stream<AnnotationInfo> 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()
Expand Down

0 comments on commit 0df8368

Please sign in to comment.