1
0
mirror of https://github.com/SKCraft/Launcher.git synced 2024-11-27 12:46:22 +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);
// Put the runtime from the config in the model if it isn't
boolean configRuntimeFound = Arrays.stream(javaRuntimes).anyMatch(r -> config.getJavaRuntime().equals(r));
if (!configRuntimeFound) {
boolean configRuntimeFound = Arrays.stream(javaRuntimes).anyMatch(r -> r.equals(config.getJavaRuntime()));
if (!configRuntimeFound && config.getJavaRuntime() != null) {
model.insertElementAt(config.getJavaRuntime(), 0);
}