fesch / Structorizer.Desktop

Structorizer is a little tool which you can use to create Nassi-Schneiderman Diagrams (NSD).
https://structorizer.fisch.lu
GNU General Public License v3.0
65 stars 20 forks source link

The substitution preview in the Translator Row Editor fails if Translator is operated stand-alone. #1095

Closed codemanyak closed 1 year ago

codemanyak commented 1 year ago

When Translator is started stand-alone (i.e., via translator.sh or translator.bat, respectively, as far as available, or as java -cp "Structorizer.app/Contents/Java/Structorizer.jar" lu.fisch.structorizer.locales.Translator) then the "Preview" button in the following dialog won't work: grafik Instead, a "silent" NullPointerException stacktrace runs into the error stream:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at lu.fisch.structorizer.gui.ElementNames.getElementName(ElementNames.java:207)
    at lu.fisch.structorizer.gui.ElementNames.getElementName(ElementNames.java:243)
    at lu.fisch.structorizer.gui.ElementNames.resolveElementNames(ElementNames.java:325)
    at lu.fisch.structorizer.locales.TranslatorRowEditor.itemStateChanged(TranslatorRowEditor.java:600)
    at java.desktop/javax.swing.AbstractButton.fireItemStateChanged(AbstractButton.java:1995)
    at java.desktop/javax.swing.AbstractButton$Handler.itemStateChanged(AbstractButton.java:2315)
    at java.desktop/javax.swing.DefaultButtonModel.fireItemStateChanged(DefaultButtonModel.java:458)
    at java.desktop/javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton.java:364)
    at java.desktop/javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:382)
    [...]

This is caused by:

  1. a withheld argument value in the getElementName() delegation hierarchy and
  2. missing precautions against null elements in a configuration array.

When started from Structorizer menu, however, this is unlikely to happen.