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,6 +56,9 @@ public class ConfigData<T> { //TODO: Save after a while
|
|||
val = primitiveDef;
|
||||
}
|
||||
if (!saved && Objects.equals(val, primitiveDef)) { //String needs .equals()
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue