Assign the config map when there is no default
This commit is contained in:
parent
bf5afb05bd
commit
b8b43e5be1
|
@ -96,13 +96,14 @@ open class Config<T: Any>(
|
|||
}
|
||||
}
|
||||
|
||||
if (localConfig == null) {
|
||||
val generateLocalConfig = localConfig == null
|
||||
if (generateLocalConfig) {
|
||||
localConfig = createDefaultObject()
|
||||
save()
|
||||
configMap = createConfigMap(localConfig)
|
||||
}
|
||||
|
||||
// now, we make a COPY of the original values from the file (so when saving, we know what the overloaded values are and not save them)
|
||||
originalConfig = localConfig
|
||||
originalConfig = localConfig!!
|
||||
// create the map that knows what members have what values
|
||||
originalConfigMap = createConfigMap(originalConfig)
|
||||
|
||||
|
@ -112,6 +113,10 @@ open class Config<T: Any>(
|
|||
// create the map that knows what members have what values
|
||||
configMap = createConfigMap(config)
|
||||
|
||||
if (generateLocalConfig) {
|
||||
save()
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue