PY-44026 Fix IOOBE in the GlobalSearchScope, causing repeated reindexing

GitOrigin-RevId: ed38aec8490d51982f8f326b21714c496a0ed576
This commit is contained in:
Mikhail Golubev
2021-02-17 15:56:30 +00:00
committed by intellij-monorepo-bot
parent 6674b17b74
commit e40791ec88
@@ -212,7 +212,8 @@ public class PyQualifiedNameCompletionMatcher {
VirtualFile closestRoot = findClosestRoot(nameAnchor, projectFileIndex);
if (closestRoot == null) return null;
String relativePath = VfsUtilCore.getRelativePath(nameAnchor, closestRoot);
if (relativePath == null) return null;
// A relative path can be empty in case of __init__.py directly inside a root.
if (relativePath == null || relativePath.isEmpty()) return null;
return convertPathToImportableQualifiedName(relativePath);
}