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(); this.workPath.mkdirs();
// if default work files exist, copy them (don't overwrite existing!) // if default work files exist, copy them (don't overwrite existing!)
File defaultWorkPath = new File("defaults/data/work"); File defaultWorkPath = new File("defaults/data/work");
for (String fs: defaultWorkPath.list()) { if (defaultWorkPath.list() != null) {
File wf = new File(this.workPath, fs); for (String fs : defaultWorkPath.list()) {
if (!wf.exists()) { File wf = new File(this.workPath, fs);
Files.copy(new File(defaultWorkPath, fs), wf); if (!wf.exists()) {
Files.copy(new File(defaultWorkPath, fs), wf);
}
} }
} }

Loading…
Cancel
Save