1
0
mirror of https://github.com/Suiranoil/SkinRestorer.git synced 2026-01-16 04:42:12 +00:00

verify and fix config

This commit is contained in:
2024-08-20 13:14:39 +03:00
parent 4339753271
commit 7fcf515790

View File

@@ -54,8 +54,24 @@ public final class Config {
if (config == null)
config = new Config();
config.verifyAndFix();
FileUtils.writeFile(path.resolve(Config.CONFIG_FILENAME), JsonUtils.toJson(config));
return config;
}
private void verifyAndFix() {
if (this.language == null || this.language.isEmpty())
this.language = "en_us";
if (this.firstJoinSkinProvider == null)
this.firstJoinSkinProvider = FirstJoinSkinProvider.MOJANG;
if (this.proxy == null)
this.proxy = "";
if (this.requestTimeout <= 0)
this.requestTimeout = 10;
}
}