* Bug #12290 fixed - AFFICH_m block inside a superblock led to java null pointer... 46/10446/3
Alexandre HERISSE [Mon, 11 Feb 2013 12:11:55 +0000 (13:11 +0100)]
Change-Id: I3592f6fa56e6a2a0a4142edcbdf25aa53b152752

scilab/CHANGES_5.4.X
scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/AfficheBlock.java

index b4120cd..565ba5a 100644 (file)
@@ -146,6 +146,9 @@ Xcos
 * Bug #12265 fixed - xcos_simulate help example diagrams were badly rendered
                      due to CLR blocks.
 
+* Bug #12290 fixed - AFFICH_m block inside a superblock led to java null
+                     pointer exception.
+
 
 Documentation
 ==============
index b68d370..ec53363 100644 (file)
@@ -94,17 +94,19 @@ public final class AfficheBlock extends BasicBlock {
          */
         private void update(String uid, String[][] data) {
             final Object cell = Xcos.getInstance().lookupForCell(new String[] { uid });
-            final XcosDiagram diag = Xcos.findParent(cell);
-            final String value = getText(data);
+            if (cell != null) {
+                final XcosDiagram diag = Xcos.findParent(cell);
+                final String value = getText(data);
 
-            diag.getModel().setValue(cell, value);
+                diag.getModel().setValue(cell, value);
 
-            final mxCellState state = diag.getView().getState(cell);
-            if (state != null) {
-                state.setLabel(value);
-            }
+                final mxCellState state = diag.getView().getState(cell);
+                if (state != null) {
+                    state.setLabel(value);
+                }
 
-            diag.getAsComponent().redraw(state);
+                diag.getAsComponent().redraw(state);
+            }
         }
 
         /**