Fixed INSTANCE not being assigned
This commit is contained in:
@ -19,13 +19,14 @@ public class ConfigManager {
|
|||||||
public static Config getConfig() {
|
public static Config getConfig() {
|
||||||
if (INSTANCE == null) {
|
if (INSTANCE == null) {
|
||||||
return load();
|
return load();
|
||||||
}else
|
} else
|
||||||
return INSTANCE;
|
return INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Config load() {
|
public static Config load() {
|
||||||
try(FileReader reader = new FileReader(CONFIG_FILE)) {
|
try(FileReader reader = new FileReader(CONFIG_FILE)) {
|
||||||
return GSON.fromJson(reader, Config.class);
|
INSTANCE = GSON.fromJson(reader, Config.class);
|
||||||
|
return INSTANCE;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Config config = new Config();
|
Config config = new Config();
|
||||||
save(config);
|
save(config);
|
||||||
|
Reference in New Issue
Block a user