1
0
mirror of https://github.com/SKCraft/Launcher.git synced 2025-02-26 03:21:51 +01:00

GH-440 Fix NPE generated by config dialog when no runtime is configured

This commit is contained in:
Henry Le Grys 2021-10-25 20:09:54 +01:00
parent d1184c32b2
commit 932ef97be6

View File

@ -81,8 +81,8 @@ public class ConfigurationDialog extends JDialog {
DefaultComboBoxModel<JavaRuntime> model = new DefaultComboBoxModel<>(javaRuntimes); DefaultComboBoxModel<JavaRuntime> model = new DefaultComboBoxModel<>(javaRuntimes);
// Put the runtime from the config in the model if it isn't // Put the runtime from the config in the model if it isn't
boolean configRuntimeFound = Arrays.stream(javaRuntimes).anyMatch(r -> config.getJavaRuntime().equals(r)); boolean configRuntimeFound = Arrays.stream(javaRuntimes).anyMatch(r -> r.equals(config.getJavaRuntime()));
if (!configRuntimeFound) { if (!configRuntimeFound && config.getJavaRuntime() != null) {
model.insertElementAt(config.getJavaRuntime(), 0); model.insertElementAt(config.getJavaRuntime(), 0);
} }