mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FIX] Исправлена работа JsonConfigurable
This commit is contained in:
parent
95f5ff13c3
commit
91b7b2cd06
1 changed files with 5 additions and 0 deletions
|
@ -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<T> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue