enum fix in configs

This commit is contained in:
FalsePattern committed 2022-05-07 12:20:32 +02:00
1 parent 6cf190e651
commit fe49dd15c2
1 file changed
+1 -1
@@ -118,7 +118,7 @@ public class ConfigurationManager {
.map(ConfigurationManager::extractValue)
.orElse(field.get(null));
val possibleValues = enumValues.stream().map(Enum::name).toArray(String[]::new);
field.set(null, fieldClass.getDeclaredField(rawConfig.getString(name, category, defaultValue.name(), comment, possibleValues, langKey)));
field.set(null, fieldClass.getDeclaredField(rawConfig.getString(name, category, defaultValue.name(), comment, possibleValues, langKey)).get(null));
} else {
throw new ConfigException("Illegal config field: " + field.getName() + " in " + configClass.getName() + ": Unsupported type " + fieldClass.getName() + "! Did you forget an @Ignore annotation?");
}