Skip to content

Commit

Permalink
Fix loading corrupted lwjgl3ify-early.json
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickMG committed Feb 12, 2025
1 parent 6df8300 commit f86f9f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/me/eigenraven/lwjgl3ify/rfb/EarlyConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.nio.file.Path;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

import com.google.gson.Gson;
Expand Down Expand Up @@ -91,7 +92,10 @@ public static void load() {
final String earlyConfigContents = new String(
Files.readAllBytes(earlyConfigPath),
StandardCharsets.UTF_8);
cfg = gson.fromJson(earlyConfigContents, ConfigObject.class);
ConfigObject parsedConfig = gson.fromJson(earlyConfigContents, ConfigObject.class);
if (Objects.nonNull(parsedConfig)) {
cfg = parsedConfig;
}
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit f86f9f4

Please sign in to comment.