diff options
Diffstat (limited to 'java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java')
-rw-r--r-- | java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java b/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java index aff69ec85da9..b3aed0603150 100644 --- a/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java +++ b/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java @@ -194,7 +194,7 @@ public class GlobalJavaInspectionContextImpl extends GlobalJavaInspectionContext final SearchScope searchScope = new GlobalSearchScope(refManager.getProject()) { @Override public boolean contains(@NotNull VirtualFile file) { - return !scope.contains(file) || file.getFileType() != StdFileTypes.JAVA; + return scope != null && !scope.contains(file) || file.getFileType() != StdFileTypes.JAVA; } @Override @@ -394,7 +394,7 @@ public class GlobalJavaInspectionContextImpl extends GlobalJavaInspectionContext @Override public boolean execute(PsiReference reference) { AnalysisScope scope = context.getRefManager().getScope(); - if (scope.contains(reference.getElement()) && reference.getElement().getLanguage() == StdLanguages.JAVA || + if (scope != null && scope.contains(reference.getElement()) && reference.getElement().getLanguage() == StdLanguages.JAVA || PsiTreeUtil.getParentOfType(reference.getElement(), PsiDocComment.class) != null) { return true; } |