catch INRE in occurrence navigation actions (EA-65022 - INRE: FileBasedIndexImpl...
[idea/community.git] / platform / platform-impl / src / com / intellij / ide / actions / OccurenceNavigatorActionBase.java
index c7ae78f0cd5923edc848d881888f1198b9ac85e4..5b3c7582f7c6e9a6232b4d6613fc0e37aba4dc47 100644 (file)
@@ -19,6 +19,7 @@ package com.intellij.ide.actions;
 import com.intellij.ide.IdeBundle;
 import com.intellij.ide.OccurenceNavigator;
 import com.intellij.openapi.actionSystem.*;
 import com.intellij.ide.IdeBundle;
 import com.intellij.ide.OccurenceNavigator;
 import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.project.IndexNotReadyException;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.util.Condition;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.util.Condition;
@@ -79,8 +80,13 @@ abstract class OccurenceNavigatorActionBase extends AnAction implements DumbAwar
       return;
     }
     presentation.setVisible(true);
       return;
     }
     presentation.setVisible(true);
-    presentation.setEnabled(hasOccurenceToGo(navigator));
-    presentation.setText(getDescription(navigator));
+    try {
+      presentation.setEnabled(hasOccurenceToGo(navigator));
+      presentation.setText(getDescription(navigator));
+    }
+    catch (IndexNotReadyException e) {
+      presentation.setEnabled(false);
+    }
   }
 
   protected abstract OccurenceNavigator.OccurenceInfo go(OccurenceNavigator navigator);
   }
 
   protected abstract OccurenceNavigator.OccurenceInfo go(OccurenceNavigator navigator);