Skip to content

Commit

Permalink
Check for PVC corruption
Browse files Browse the repository at this point in the history
  • Loading branch information
artdeell committed Dec 11, 2021
1 parent 4b69b98 commit 51ca5d8
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

1 comment on commit 51ca5d8

@Mathias-Boulay
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lmao this doesn't solve the underlying issue.

Please sign in to comment.