fix nullpointer when running for the first time
This commit is contained in:
parent
9b3334c92b
commit
97133e24c6
|
@ -174,7 +174,7 @@ public class Configuration {
|
||||||
}
|
}
|
||||||
|
|
||||||
private File loadDirectory(File dir, File defaultDir, String kind) {
|
private File loadDirectory(File dir, File defaultDir, String kind) {
|
||||||
if (dir.exists() && dir.isDirectory()) {
|
if (dir != null && dir.exists() && dir.isDirectory()) {
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
if (!defaultDir.isDirectory() && !defaultDir.mkdir()) {
|
if (!defaultDir.isDirectory() && !defaultDir.mkdir()) {
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class OptionsService {
|
||||||
public void loadOptions() {
|
public void loadOptions() {
|
||||||
// if no config file, use default settings
|
// if no config file, use default settings
|
||||||
if (!config.OPTIONS_FILE.isFile()) {
|
if (!config.OPTIONS_FILE.isFile()) {
|
||||||
|
config.loadDirectories();
|
||||||
saveOptions();
|
saveOptions();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user