mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 19:47:49 +01:00
Attempts to fix NPE on first config save (#525)
This commit is contained in:
parent
0270feef7a
commit
762ea40794
@ -5,6 +5,7 @@
|
|||||||
package com.djrapitops.plan.system.file;
|
package com.djrapitops.plan.system.file;
|
||||||
|
|
||||||
import com.djrapitops.plan.PlanPlugin;
|
import com.djrapitops.plan.PlanPlugin;
|
||||||
|
import com.djrapitops.plan.api.exceptions.EnableException;
|
||||||
import com.djrapitops.plan.system.PlanSystem;
|
import com.djrapitops.plan.system.PlanSystem;
|
||||||
import com.djrapitops.plan.system.SubSystem;
|
import com.djrapitops.plan.system.SubSystem;
|
||||||
import com.djrapitops.plan.utilities.file.FileUtil;
|
import com.djrapitops.plan.utilities.file.FileUtil;
|
||||||
@ -56,8 +57,16 @@ public class FileSystem implements SubSystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enable() {
|
public void enable() throws EnableException {
|
||||||
dataFolder.mkdirs();
|
dataFolder.mkdirs();
|
||||||
|
try {
|
||||||
|
if (configFile.exists()) {
|
||||||
|
configFile.createNewFile();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new EnableException("Failed to create config.yml", e);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user