Skip to content

Cannot always add legend for Xcos links

Bug Description

Sometimes it is not possible to add a legend on links, the dialog box does not open, with a Java error

Steps to reproduce

Open the example diagram of the doc page of the CMSCOPE block, then right-click on any link just next to the CMSCOPE block and select Format/Edit menu, then you get a Java error:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "com.mxgraph.util.mxPoint.getX()" because "<local8>" is null
	at org.scilab.modules.xcos.graph.XcosDiagram.createCellIdentifier(Unknown Source)
	at org.scilab.modules.xcos.graph.XcosDiagram.getOrCreateCellIdentifier(Unknown Source)
	at org.scilab.modules.xcos.actions.EditFormatAction.createDialog(Unknown Source)
	at org.scilab.modules.xcos.actions.EditFormatAction.showDialog(Unknown Source)
	at org.scilab.modules.xcos.actions.EditFormatAction.actionPerformed(Unknown Source)
...

What is the expected correct behavior?

on a simpler diagram (see e.g. https://scilab.discourse.group/t/how-to-change-the-label-of-independent-variables-in-cmscope/955/4) the legend can be defined.

Edited by Stéphane MOTTELET