Config fix
Saving primitive defaults even if def is null
This commit is contained in:
parent
138259412f
commit
9620ae44f6
1 changed files with 4 additions and 1 deletions
|
@ -56,7 +56,10 @@ public class ConfigData<T> { //TODO: Save after a while
|
||||||
val = primitiveDef;
|
val = primitiveDef;
|
||||||
}
|
}
|
||||||
if (!saved && Objects.equals(val, primitiveDef)) { //String needs .equals()
|
if (!saved && Objects.equals(val, primitiveDef)) { //String needs .equals()
|
||||||
set(def); //Save default value - def is always set
|
if (def == null && config != null) //In Discord's case def may be null
|
||||||
|
config.set(path, primitiveDef);
|
||||||
|
else
|
||||||
|
set(def); //Save default value - def is always set
|
||||||
saved = true;
|
saved = true;
|
||||||
}
|
}
|
||||||
if (getter != null) {
|
if (getter != null) {
|
||||||
|
|
Loading…
Reference in a new issue