From 6e87b38aeeb25c32e79c6bc235456954bba3ecb2 Mon Sep 17 00:00:00 2001 From: Marco Belladelli Date: Wed, 21 Dec 2022 16:38:33 +0100 Subject: [PATCH] HHH-15850 Check if escape character is null in QuerySplitter --- .../java/org/hibernate/query/hql/internal/QuerySplitter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/QuerySplitter.java b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/QuerySplitter.java index 0969469cf7..aa09b37f2e 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/QuerySplitter.java +++ b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/QuerySplitter.java @@ -913,7 +913,9 @@ public class QuerySplitter { return new SqmLikePredicate( (SqmExpression) predicate.getMatchExpression().accept( this ), (SqmExpression) predicate.getPattern().accept( this ), - (SqmExpression) predicate.getEscapeCharacter().accept( this ), + predicate.getEscapeCharacter() == null ? + null : + (SqmExpression) predicate.getEscapeCharacter().accept( this ), predicate.nodeBuilder() ); }