Skip to content

Commit 4c93c3f

Browse files
committed
866: IndexNotReadyException while opening a context menu
1 parent 703fc13 commit 4c93c3f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/com/magento/idea/magento2plugin/indexes/ModuleIndex.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package com.magento.idea.magento2plugin.indexes;
77

8+
import com.intellij.openapi.project.DumbService;
89
import com.intellij.openapi.project.Project;
910
import com.intellij.openapi.vfs.VfsUtilCore;
1011
import com.intellij.openapi.vfs.VirtualFile;
@@ -120,6 +121,10 @@ private List<String> getNames(
120121
public @Nullable PsiDirectory getModuleDirectoryByModuleName(final String moduleName) {
121122
final FileBasedIndex index = FileBasedIndex
122123
.getInstance();
124+
125+
if (DumbService.getInstance(project).isDumb()) {
126+
return null;
127+
}
123128
final Collection<VirtualFile> files = index.getContainingFiles(
124129
ModuleNameIndex.KEY,
125130
moduleName,

0 commit comments

Comments
 (0)