Skip to content

Commit

Permalink
Merge pull request #30976 from manovotn/issue30965
Browse files Browse the repository at this point in the history
Metrics - check if index contains class before attempting to use it
  • Loading branch information
jmartisk authored Feb 8, 2023
2 parents 82bdd68 + 3cb61b7 commit cbf8449
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 cbf8449

Please sign in to comment.