[java] EA-802471 NPE: AnnotationUtil.findAnnotations

GitOrigin-RevId: 25beb291c34c586f19ee3a1a508036960cd15bcd
This commit is contained in:
Yuriy Artamonov
2023-02-21 17:26:32 +01:00
committed by intellij-monorepo-bot
parent 944e7807a1
commit 66a3a45f39

View File

@@ -186,7 +186,8 @@ public class AnnotationUtil {
final PsiAnnotation[] annotations = modifierList.getAnnotations();
ArrayList<PsiAnnotation> result = null;
for (final PsiAnnotation psiAnnotation : annotations) {
if (annotationNames.contains(psiAnnotation.getQualifiedName())) {
String qualifiedName = psiAnnotation.getQualifiedName();
if (qualifiedName != null && annotationNames.contains(qualifiedName)) {
if (result == null) result = new ArrayList<>();
result.add(psiAnnotation);
}