diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmTreePrinter.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmTreePrinter.java index 15d85c6d73..d6eefcc882 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmTreePrinter.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmTreePrinter.java @@ -958,7 +958,9 @@ public class SqmTreePrinter implements SemanticQueryWalker { () -> { predicate.getPattern().accept( this ); predicate.getMatchExpression().accept( this ); - predicate.getEscapeCharacter().accept( this ); + if ( predicate.getEscapeCharacter() != null ) { + predicate.getEscapeCharacter().accept( this ); + } } ); return null;