fix an NPE that occurred if a QL 'delete' statement had no predicate (#8190)

(bug exposed by Jakarta Data TCK)

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-04-17 02:35:27 +02:00
parent a7ad74f75f
commit 18c0fd7a78
1 changed files with 2 additions and 1 deletions

View File

@ -61,7 +61,8 @@ public abstract class AbstractSqmRestrictedDmlStatement<T> extends AbstractSqmDm
}
else {
final SqmWhereClause whereClause = new SqmWhereClause( nodeBuilder() );
whereClause.setPredicate( getWhereClause().getPredicate().copy( context ) );
final SqmPredicate predicate = getWhereClause().getPredicate();
whereClause.setPredicate( predicate==null ? null : predicate.copy( context ) );
return whereClause;
}
}