fix: exception if default work files don't exist

pull/1/head
reger 12 years ago
parent 9e4033f229
commit 0148f1bb8c

@ -339,10 +339,12 @@ public final class Switchboard extends serverSwitch {
this.workPath.mkdirs();
// if default work files exist, copy them (don't overwrite existing!)
File defaultWorkPath = new File("defaults/data/work");
for (String fs: defaultWorkPath.list()) {
File wf = new File(this.workPath, fs);
if (!wf.exists()) {
Files.copy(new File(defaultWorkPath, fs), wf);
if (defaultWorkPath.list() != null) {
for (String fs : defaultWorkPath.list()) {
File wf = new File(this.workPath, fs);
if (!wf.exists()) {
Files.copy(new File(defaultWorkPath, fs), wf);
}
}
}

Loading…
Cancel
Save