From 91b7b2cd06592cf0e2a85ac9ca46896a687fd94d Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 7 Jun 2019 05:27:46 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0?= =?UTF-8?q?=20JsonConfigurable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/pro/gravit/launcher/config/JsonConfigurable.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/config/JsonConfigurable.java b/LauncherAPI/src/main/java/pro/gravit/launcher/config/JsonConfigurable.java index 7d4ed67f..6972e023 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/config/JsonConfigurable.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/config/JsonConfigurable.java @@ -9,6 +9,7 @@ import pro.gravit.launcher.Launcher; import pro.gravit.launcher.LauncherAPI; import pro.gravit.utils.helper.IOHelper; +import pro.gravit.utils.helper.LogHelper; public abstract class JsonConfigurable { private Type type; @@ -42,6 +43,10 @@ public void loadConfig(Path configPath) throws IOException { if (generateConfigIfNotExists(configPath)) return; try (BufferedReader reader = IOHelper.newReader(configPath)) { setConfig(Launcher.gsonManager.configGson.fromJson(reader, type)); + } catch (Exception e) + { + LogHelper.error(e); + resetConfig(configPath); } }