Skip to content

Commit 303cfa6

Browse files
committed
fix trac issue #22342
1 parent 6bdbe5c commit 303cfa6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/main/java/org/openstreetmap/josm/plugins/scripting/preferences/graalvm/GraalVMConfigurationPanel.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ protected JPanel buildTabs() {
6767
if (GraalVMFacadeFactory.isGraalVMPresent()) {
6868
tpPreferencesTabs.add(tr("ES Module repositories"),
6969
pnlESModuleRepoConfiguration = new ESModuleRepoConfigurationPanel());
70+
tpPreferencesTabs.add(tr("CommonJS module repositories"),
71+
pnlCommonJSRepoConfiguration = new CommonJSRepoConfigurationPanel());
7072
}
71-
tpPreferencesTabs.add(tr("CommonJS module repositories"),
72-
pnlCommonJSRepoConfiguration = new CommonJSRepoConfigurationPanel());
73+
7374
pnl.add(tpPreferencesTabs, BorderLayout.CENTER);
7475
return pnl;
7576
}
@@ -88,8 +89,12 @@ public GraalVMConfigurationPanel() {
8889
* Persist preferences to the JOSM preferences file.
8990
*/
9091
public void persistToPreferences() {
91-
pnlCommonJSRepoConfiguration.persistToPreferences();
92-
pnlESModuleRepoConfiguration.persistToPreferences();
92+
if (pnlCommonJSRepoConfiguration != null) {
93+
pnlCommonJSRepoConfiguration.persistToPreferences();
94+
}
95+
if (pnlESModuleRepoConfiguration != null) {
96+
pnlESModuleRepoConfiguration.persistToPreferences();
97+
}
9398
}
9499

95100
@Override

0 commit comments

Comments
 (0)