fix: actually skip unsupported values in configs
This commit is contained in:
parent
d579c19f6b
commit
83d85abb17
|
@ -46,15 +46,18 @@ public class DefaultConfigIO {
|
|||
reader.beginObject();
|
||||
while (reader.peek() != Token.END_OBJECT) {
|
||||
String name = reader.nextName();
|
||||
if (!actions.containsKey(name)) {
|
||||
DefaultConfigIO.Action action = actions.get(name);
|
||||
if (action == null) {
|
||||
LibJf.LOGGER.warn("Unrecognized key in config for " + id + ": " + name);
|
||||
reader.skipValue();
|
||||
continue;
|
||||
}
|
||||
if (!appeared.add(name)) {
|
||||
LibJf.LOGGER.warn("Duplicate key in config for " + id + ": " + name);
|
||||
reader.skipValue();
|
||||
continue;
|
||||
}
|
||||
actions.get(name).task.accept(reader);
|
||||
action.task.accept(reader);
|
||||
}
|
||||
reader.endObject();
|
||||
actions.forEach((name, action) -> {
|
||||
|
|
Loading…
Reference in New Issue