don't search for inheritors of an invalid class (EA-65106 - PIEAE: StubBasedPsiElemen...
[idea/community.git] / java / java-indexing-api / src / com / intellij / psi / search / searches / ClassInheritorsSearch.java
index 1b925e02eabec5e44193aede7fb845c64b30ad0f..87cc8e38cb2ff637031a384ee45adede4e1b6e8b 100644 (file)
@@ -18,6 +18,7 @@ package com.intellij.psi.search.searches;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.extensions.ExtensionPointName;
+import com.intellij.openapi.progress.ProcessCanceledException;
 import com.intellij.openapi.progress.ProgressIndicator;
 import com.intellij.openapi.progress.ProgressIndicatorProvider;
 import com.intellij.openapi.project.Project;
@@ -170,6 +171,9 @@ public class ClassInheritorsSearch extends ExtensibleQueryFactory<PsiClass, Clas
     return search(aClass, ApplicationManager.getApplication().runReadAction(new Computable<SearchScope>() {
       @Override
       public SearchScope compute() {
+        if (!aClass.isValid()) {
+          throw new ProcessCanceledException();
+        }
         return aClass.getUseScope();
       }
     }), checkDeep);