EA-62283 - IAE: AnnotationUtil.findAnnotationInHierarchy
authorYann Cébron <yann.cebron@jetbrains.com>
Mon, 3 Nov 2014 10:16:18 +0000 (11:16 +0100)
committerYann Cébron <yann.cebron@jetbrains.com>
Mon, 3 Nov 2014 10:16:18 +0000 (11:16 +0100)
plugins/devkit/src/testAssistant/TestDataLineMarkerProvider.java

index 60d805044f0c290061cab5cdd1c2c05b0610e6de..a1a76940ef7f204c11917c746a2a30262fb58d98 100644 (file)
@@ -124,10 +124,11 @@ public class TestDataLineMarkerProvider implements LineMarkerProvider {
   }
 
   @Nullable
-  public static String getTestDataBasePath(PsiClass psiClass) {
-    final PsiAnnotation annotation = AnnotationUtil.findAnnotationInHierarchy(psiClass,
-                                                                              Collections.singleton(
-                                                                                TEST_DATA_PATH_ANNOTATION_QUALIFIED_NAME));
+  public static String getTestDataBasePath(@Nullable PsiClass psiClass) {
+    if (psiClass == null) return null;
+
+    final PsiAnnotation annotation =
+      AnnotationUtil.findAnnotationInHierarchy(psiClass, Collections.singleton(TEST_DATA_PATH_ANNOTATION_QUALIFIED_NAME));
     if (annotation != null) {
       final PsiAnnotationMemberValue value = annotation.findAttributeValue(PsiAnnotation.DEFAULT_REFERENCED_METHOD_NAME);
       if (value instanceof PsiExpression) {