CoverityFix-CID:1350445 Dereference null return value 61/20461/4
Nimish Kapoor [Sun, 5 Aug 2018 20:00:18 +0000 (01:00 +0530)]
Change-Id: I9e2fd7b9b5a127be4dab469ae508600bc93b01fc

scilab/modules/xcos/src/java/org/scilab/modules/xcos/graph/XcosDiagram.java

index d640902..574939d 100644 (file)
@@ -2082,7 +2082,11 @@ public class XcosDiagram extends ScilabGraph {
                         while (ex instanceof RuntimeException) {
                             ex = ex.getCause();
                         }
-                        instance.setLastError(ex.getMessage());
+                        try {
+                            instance.setLastError(ex.getMessage());
+                        } catch (NullPointerException exp) {
+                            exp.printStackTrace();
+                        }
                     }
                     instance.notify();
                 }