catch INRE in occurrence navigation actions (EA-65022 - INRE: FileBasedIndexImpl...
authorpeter <peter@jetbrains.com>
Wed, 18 Feb 2015 11:30:44 +0000 (12:30 +0100)
committerpeter <peter@jetbrains.com>
Wed, 18 Feb 2015 15:18:41 +0000 (16:18 +0100)
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.openapi.project.IndexNotReadyException;
 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);
-    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);