fix(gateway-vertx) Handle nulls in JSON to Map conversion.
@@ -318,13 +318,17 @@ public class VertxEngineConfig implements IEngineConfig {
list.forEach(elem -> jsonMapToProperties(pathSoFar, elem, output));
} else { // Value
if (output.containsKey(pathSoFar)) {
- output.put(pathSoFar, SimpleStringUtils.join(",", output.get(pathSoFar), value.toString()));
+ output.put(pathSoFar, SimpleStringUtils.join(",", output.get(pathSoFar), valueOrNull(value)));
} else {
- output.put(pathSoFar, value.toString());
+ output.put(pathSoFar, valueOrNull(value));
}
}
}
+ private String valueOrNull(Object value) {
+ return value == null ? null : value.toString();
+ }
+
private String determineKey(String pathSoFar, String key) {
return pathSoFar.length() == 0 ? key : pathSoFar + "." + key;
}
