IDEA-80417
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Fri, 27 Jan 2012 10:33:13 +0000 (14:33 +0400)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Fri, 27 Jan 2012 10:34:10 +0000 (14:34 +0400)
platform/platform-impl/src/com/intellij/ide/actions/UndoRedoAction.java

index 0fc43b2ee49adf3299aae61aab994cc2419ce331..0d09446cef7a66272a12dcf5e7276ea8e992bec7 100644 (file)
@@ -53,7 +53,11 @@ public abstract class UndoRedoAction extends DumbAwareAction {
     }
 
     UndoManager undoManager = getUndoManager(editor, dataContext);
-    presentation.setEnabled(undoManager != null && isAvailable(editor, undoManager));
+    if (undoManager == null) {
+      presentation.setEnabled(false);
+      return;
+    }
+    presentation.setEnabled(isAvailable(editor, undoManager));
 
     Pair<String, String> pair = getActionNameAndDescription(editor, undoManager);