fix(config-core): hopefully prevent config parsing issue with nulls
ci/woodpecker/push/docs Pipeline was successful Details
ci/woodpecker/push/jfmod Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2024-03-12 14:16:59 +01:00
parent 45cbc38d68
commit 580a74fee8
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 4 additions and 2 deletions

View File

@ -135,8 +135,10 @@ public class DslEntryInfo<T> implements EntryInfo<T> {
} else if (type.isString()) {
if (next == JsonToken.STRING || next == JsonToken.NUMBER) setUnchecked(reader.nextString());
else if (next == JsonToken.BOOLEAN) setUnchecked(Boolean.toString(reader.nextBoolean()));
else if (next == JsonToken.NULL) setUnchecked(null);
else LibJf.LOGGER.error("Unexpected value for " + name + ": expected string but got " + next);
else if (next == JsonToken.NULL) {
reader.nextNull();
setUnchecked(null);
} else LibJf.LOGGER.error("Unexpected value for " + name + ": expected string but got " + next);
} else if (type.isInt()) {
if (next == JsonToken.NUMBER) setUnchecked(reader.nextInt());
else LibJf.LOGGER.error("Unexpected value for " + name + ": expected number but got " + next);