From 31fafb1d4f750e3f0119d2392c643e407d787127 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Tue, 22 Nov 2022 18:00:00 +0100 Subject: [PATCH] HHH-15721 NullPointerException in BaseSqmToSqlAstConverter.visitJunctionPredicate with combination of treats --- .../hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java index 5758e526d6..51c3659d2b 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java @@ -6503,10 +6503,7 @@ public abstract class BaseSqmToSqlAstConverter extends Base boolean hasAnyTreatUsage = false; for ( SqmPredicate subPredicate : predicate.getPredicates() ) { disjunction.add( (Predicate) subPredicate.accept( this ) ); - if ( conjunctTreatUsages.isEmpty() ) { - conjunctTreatUsagesList.add( null ); - } - else { + if ( !conjunctTreatUsages.isEmpty() ) { hasAnyTreatUsage = true; for ( Map.Entry, Set> entry : conjunctTreatUsages.entrySet() ) { conjunctTreatUsagesUnion.computeIfAbsent( entry.getKey(), k -> new HashSet<>() )