Export: forgot to check non null before dispose 75/10575/2
Calixte DENIZET [Fri, 22 Feb 2013 11:09:42 +0000 (12:09 +0100)]
Change-Id: Ie3b5acb9473d175aa2510fdaff8682088c48078e

scilab/modules/graphic_export/src/java/org/scilab/modules/graphic_export/Export.java

index 2b4d4ec..cbb0ecb 100644 (file)
@@ -465,7 +465,9 @@ public class Export {
 
         @Override
         public void dispose() {
-            g2d.dispose();
+            if (g2d != null) {
+                g2d.dispose();
+            }
         }
     }
 
@@ -597,7 +599,9 @@ public class Export {
 
         @Override
         public void dispose() {
-            g2d.dispose();
+            if (g2d != null) {
+                g2d.dispose();
+            }
         }
     }
 
@@ -726,7 +730,9 @@ public class Export {
 
         @Override
         public void dispose() {
-            g2d.dispose();
+            if (g2d != null) {
+                g2d.dispose();
+            }
         }
     }