fix NPE
authorpeter <peter@jetbrains.com>
Fri, 27 Jan 2012 22:03:03 +0000 (23:03 +0100)
committerpeter <peter@jetbrains.com>
Fri, 27 Jan 2012 22:03:03 +0000 (23:03 +0100)
platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java

index 1b594abdc2b10ce5eb7e49108f75853417538319..14d7b9b9c5e5d6a04a840efa358c8408d68fcfab 100644 (file)
@@ -442,7 +442,7 @@ public class FindInProjectUtil {
 
   @Nullable
   private static GlobalSearchScope toGlobal(Project project, @Nullable SearchScope scope) {
 
   @Nullable
   private static GlobalSearchScope toGlobal(Project project, @Nullable SearchScope scope) {
-    if (scope instanceof GlobalSearchScope) {
+    if (scope instanceof GlobalSearchScope || scope == null) {
       return (GlobalSearchScope)scope;
     }
     Set<VirtualFile> files = new HashSet<VirtualFile>();
       return (GlobalSearchScope)scope;
     }
     Set<VirtualFile> files = new HashSet<VirtualFile>();