fix NPE in UndoRedoAction update
authorDmitry Jemerov <yole@jetbrains.com>
Fri, 12 Feb 2010 11:18:29 +0000 (12 14:18 +0300)
committerDmitry Jemerov <yole@jetbrains.com>
Fri, 12 Feb 2010 11:35:11 +0000 (12 14:35 +0300)
platform/platform-impl/src/com/intellij/ide/actions/UndoRedoAction.java

index 08c443e..4ebd989 100644 (file)
@@ -56,9 +56,12 @@ public abstract class UndoRedoAction extends DumbAwareAction {
     FileEditor editor = PlatformDataKeys.FILE_EDITOR.getData(dataContext);
 
     // do not allow global undo in dialogs
-    if (editor == null && PlatformDataKeys.IS_MODAL_CONTEXT.getData(dataContext)) {
-      presentation.setEnabled(false);
-      return;
+    if (editor == null) {
+      final Boolean isModalContext = PlatformDataKeys.IS_MODAL_CONTEXT.getData(dataContext);
+      if (isModalContext != null && isModalContext) {
+        presentation.setEnabled(false);
+        return;
+      }
     }
 
     UndoManager undoManager = getUndoManager(editor, dataContext);