From 207296b52c15034e830acb864b29bbec60c10626 Mon Sep 17 00:00:00 2001 From: _Mads Date: Tue, 27 Feb 2024 18:18:51 +0100 Subject: [PATCH] Fix update system --- .../volder/transporter/updater/UpdateManager.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/ml/volder/transporter/updater/UpdateManager.java b/src/main/java/ml/volder/transporter/updater/UpdateManager.java index 52ad83f..5a2de9a 100644 --- a/src/main/java/ml/volder/transporter/updater/UpdateManager.java +++ b/src/main/java/ml/volder/transporter/updater/UpdateManager.java @@ -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;