Skip to content

Commit

Permalink
Fix update system
Browse files Browse the repository at this point in the history
  • Loading branch information
TFSMads committed Feb 27, 2024
1 parent b7ca7c5 commit 207296b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/main/java/ml/volder/transporter/updater/UpdateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,12 @@ private static class UpdateInfoJson {
public static boolean isUpToDate() {
InputStream transporterInputStream = UpdateManager.class.getClassLoader().getResourceAsStream("transporter.json");
if(transporterInputStream != null){
Reader r = null;
try {
r = new InputStreamReader(transporterInputStream, "UTF-8");
} catch (UnsupportedEncodingException e) {
return true;
}
JsonObject transporterJson = new JsonParser().parse(r).getAsJsonObject();
if(transporterJson.has("autoUpdate") && !transporterJson.get("autoUpdate").getAsBoolean())
return true;
Reader r = new InputStreamReader(transporterInputStream, "UTF-8");
JsonObject transporterJson = new JsonParser().parse(r).getAsJsonObject();
if(transporterJson.has("autoUpdate") && !transporterJson.get("autoUpdate").getAsBoolean())
return true;
} catch (Exception ignored) {}
}
Gson gson = new Gson();
UpdateInfoJson localUpdateInfo;
Expand Down

0 comments on commit 207296b

Please sign in to comment.