Configuration tweaks - enforce default + parent file nullcheck

This commit is contained in:
Dinnerbone
2011-04-01 00:32:51 +01:00
parent cf6b46bda9
commit a250f66c2e
2 changed files with 8 additions and 1 deletions

View File

@@ -93,7 +93,10 @@ public class Configuration extends ConfigurationNode {
public boolean save() {
FileOutputStream stream = null;
file.getParentFile().mkdirs();
File parent = file.getParentFile();
if (parent != null) {
parent.mkdirs();
}
try {
stream = new FileOutputStream(file);