Bug 8135 fixed: An exception was thrown when restoring files on MacOS X
[scilab.git] / scilab / modules / scinotes / src / java / org / scilab / modules / scinotes / actions / OverwriteAction.java
index bfd5c09..30f3150 100644 (file)
@@ -47,7 +47,9 @@ public final class OverwriteAction extends DefaultAction {
         final MenuItem menuitem = createMenu(label, null, new OverwriteAction(label, editor), key);
         ((JMenuItem) menuitem.getAsSimpleMenuItem()).addPropertyChangeListener(new PropertyChangeListener() {
                 public void propertyChange(PropertyChangeEvent e) {
-                    menuitem.setEnabled(editor.getTextPane().checkExternalModif());
+                    if (editor.getTextPane() != null) {
+                        menuitem.setEnabled(editor.getTextPane().checkExternalModif());
+                    }
                 }
             });