Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,14 @@ public ValueNode evaluate(Predicate.PredicateContext ctx) {
try {
Configuration c = Configuration.builder().jsonProvider(ctx.configuration().jsonProvider()).options(Option.REQUIRE_PROPERTIES).build();
Object result = path.evaluate(ctx.item(), ctx.root(), c).getValue(false);
return result == JsonProvider.UNDEFINED ? FALSE : TRUE;
if (result == JsonProvider.UNDEFINED) {
return FALSE;
}
// If the result is an empty array, return FALSE for exists checks
if (ctx.configuration().jsonProvider().isArray(result) && ctx.configuration().jsonProvider().length(result) == 0) {
return FALSE;
}
return TRUE;
} catch (PathNotFoundException e) {
return FALSE;
}
Expand Down