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 / EvaluateSelectionAction.java
index 9c44b1a..33660f0 100644 (file)
@@ -73,11 +73,13 @@ public final class EvaluateSelectionAction extends DefaultAction {
         }
         ((JMenuItem) menuitem.getAsSimpleMenuItem()).addPropertyChangeListener(new PropertyChangeListener() {
                 public void propertyChange(PropertyChangeEvent e) {
-                    String select = editor.getTextPane().getSelectedText();
-                    if (select == null) {
-                        menuitem.setText(label1);
-                    } else {
-                        menuitem.setText(label2);
+                    if (editor.getTextPane() != null) {
+                        String select = editor.getTextPane().getSelectedText();
+                        if (select == null) {
+                            menuitem.setText(label2);
+                        } else {
+                            menuitem.setText(label1);
+                        }
                     }
                 }
             });