Skip to content

Commit b4fcdce

Browse files
Merge pull request #896 from Iamwade/866-index-not-ready-exception-while-opening-a-context-menu
866: IndexNotReadyException while opening a context menu
2 parents df337f4 + 2f085d3 commit b4fcdce

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;
@@ -118,8 +119,12 @@ private List<String> getNames(
118119
* @return PsiDirectory
119120
*/
120121
public @Nullable PsiDirectory getModuleDirectoryByModuleName(final String moduleName) {
122+
if (DumbService.getInstance(project).isDumb()) {
123+
return null;
124+
}
121125
final FileBasedIndex index = FileBasedIndex
122126
.getInstance();
127+
123128
final Collection<VirtualFile> files = index.getContainingFiles(
124129
ModuleNameIndex.KEY,
125130
moduleName,

0 commit comments

Comments
 (0)