[jsonpath] Fix exception when input string is empty (#15283)

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K
2023-07-23 17:14:16 +02:00
committed by GitHub
parent 36741bf004
commit 4afe151108

View File

@@ -59,6 +59,10 @@ public class JSonPathTransformationService implements TransformationService {
logger.debug("about to transform '{}' by the function '{}'", source, jsonPathExpression);
if (source.isBlank()) {
// return null if source is empty/blank, JSONPath will throw an IAE on empty input strings
return null;
}
try {
Object transformationResult = JsonPath.read(source, jsonPathExpression);
logger.debug("transformation resulted in '{}'", transformationResult);