Fixed a small bug fixing crash when config directory dosnt exist
This commit is contained in:
@@ -160,7 +160,11 @@ public class ConfigFileHandling {
|
||||
} catch (Exception e) {
|
||||
System.out.println("Loading file failed because of this expectation:\n"+e);
|
||||
try { // Now try remaking the file and loading it
|
||||
Files.deleteIfExists(ConfigPath);
|
||||
Path configFilePath = ConfigPath.getParent();
|
||||
if (!configFilePath.toFile().exists())
|
||||
Files.createDirectory(configFilePath);
|
||||
else
|
||||
Files.deleteIfExists(ConfigPath);
|
||||
Files.createFile(ConfigPath);
|
||||
config.load();
|
||||
} catch (IOException ex) {
|
||||
|
||||
Reference in New Issue
Block a user