Xcos: fix NPE on dynamic palette 31/19331/2
Clément DAVID [Tue, 11 Jul 2017 14:36:24 +0000 (16:36 +0200)]
Change-Id: Ib7a7e92a783cc511366b796f20b58bfd69b0d3f8

scilab/modules/xcos/src/java/org/scilab/modules/xcos/palette/PaletteCtrl.java

index 974fd69..3e87b7e 100644 (file)
@@ -133,7 +133,10 @@ public final class PaletteCtrl {
             }
 
             // add to the 'recently used blocks' panel
-            PaletteManagerView.get().getPanel().addRecentltyUsedBlock(blockCtrl.getModel());
+            PaletteManagerView pmv = PaletteManagerView.get();
+            if (pmv != null) {
+                pmv.getPanel().addRecentltyUsedBlock(blockCtrl.getModel());
+            }
 
             // render and export it
             final double margin = 15.0;