Fix replacement == null

This commit is contained in:
Duy Tran Khanh 2021-01-25 14:59:54 +07:00 committed by GitHub
parent 42f63ba5fa
commit 6b1acf2d36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ public class JSONUtils {
public static String insertSingleJSONValue(String value, Map<String, String> keyValueMap) {
String valueInserted = value;
for (Map.Entry<String, String> keyValue : keyValueMap.entrySet()) {
valueInserted = valueInserted.replace("${" + keyValue.getKey() + "}", keyValue.getValue());
valueInserted = valueInserted.replace("${" + keyValue.getKey() + "}", keyValue.getValue() == null ? "" : keyValue.getValue());
}
return valueInserted;
}