Configuration tweaks - enforce default + parent file nullcheck
This commit is contained in:
@@ -126,6 +126,7 @@ public class ConfigurationNode {
|
||||
public String getString(String path, String def) {
|
||||
String o = getString(path);
|
||||
if (o == null) {
|
||||
setProperty(path, def);
|
||||
return def;
|
||||
}
|
||||
return o;
|
||||
@@ -144,6 +145,7 @@ public class ConfigurationNode {
|
||||
public int getInt(String path, int def) {
|
||||
Integer o = castInt(getProperty(path));
|
||||
if (o == null) {
|
||||
setProperty(path, def);
|
||||
return def;
|
||||
} else {
|
||||
return o;
|
||||
@@ -163,6 +165,7 @@ public class ConfigurationNode {
|
||||
public double getDouble(String path, double def) {
|
||||
Double o = castDouble(getProperty(path));
|
||||
if (o == null) {
|
||||
setProperty(path, def);
|
||||
return def;
|
||||
} else {
|
||||
return o;
|
||||
@@ -181,6 +184,7 @@ public class ConfigurationNode {
|
||||
public boolean getBoolean(String path, boolean def) {
|
||||
Boolean o = castBoolean(getProperty(path));
|
||||
if (o == null) {
|
||||
setProperty(path, def);
|
||||
return def;
|
||||
} else {
|
||||
return o;
|
||||
|
||||
Reference in New Issue
Block a user