SciNotes: fix exception when closing the restore tab when confirmation is popup 85/14085/2
Calixte DENIZET [Thu, 20 Mar 2014 14:42:07 +0000 (15:42 +0100)]
Change-Id: Ifa6d0d4702fa77dab926b6ad615d2a2edc6c6bbe

scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/SciNotes.java

index 5e6ad16..74b9b4d 100644 (file)
@@ -871,7 +871,7 @@ public class SciNotes extends SwingScilabDockablePanel {
         boolean isContentModified = false;
         for (int i = 0; i < getTabPane().getTabCount(); i++) {
             ScilabEditorPane textPaneAt = getTextPane(i);
-            if (((ScilabDocument) textPaneAt.getDocument()).isContentModified()) {
+            if (textPaneAt != null && ((ScilabDocument) textPaneAt.getDocument()).isContentModified()) {
                 isContentModified = true;
                 break;
             }