config manager: overwrite defaults when unable to unmarshall values

This allows config key types to change without errors by resetting the
config with new default value
This commit is contained in:
Adam
2019-08-26 10:32:58 -04:00
committed by Adam
parent 90897563d0
commit 41f3909876

View File

@@ -507,7 +507,9 @@ public class ConfigManager
if (!override)
{
String current = getConfiguration(group.value(), item.keyName());
// This checks if it is set and is also unmarshallable to the correct type; so
// we will overwrite invalid config values with the default
Object current = getConfiguration(group.value(), item.keyName(), method.getReturnType());
if (current != null)
{
continue; // something else is already set