Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Update from mainline
Browse files Browse the repository at this point in the history
  • Loading branch information
artdeell committed Dec 11, 2021
2 parents 870d86d + 51ca5d8 commit 2478758
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.kdt.pojavlaunch.value;

import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;

import net.kdt.pojavlaunch.Tools;
Expand All @@ -16,7 +17,13 @@ public static void update() throws IOException {
if(configMap == null) {
pvcFile = new File(Tools.DIR_GAME_HOME,"per-version-config.json");
if(pvcFile.exists()) {
configMap = Tools.GLOBAL_GSON.fromJson(Tools.read(pvcFile.getAbsolutePath()), new TypeToken<HashMap<String,VersionConfig>>() {}.getType());
try {
configMap = Tools.GLOBAL_GSON.fromJson(Tools.read(pvcFile.getAbsolutePath()), new TypeToken<HashMap<String, VersionConfig>>() {
}.getType());
}catch(JsonSyntaxException ex) {
ex.printStackTrace();
configMap = new HashMap<>();
}
}else{
configMap = new HashMap<>();
}
Expand Down

0 comments on commit 2478758

Please sign in to comment.