Skip to content

Commit bab86f3

Browse files
committed
HHH-19926 NullPointerException when executing JPQL IN clause with null parameter on entity association
1 parent 9110c94 commit bab86f3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

hibernate-core/src/main/java/org/hibernate/query/spi/AbstractCommonQueryContract.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -816,13 +816,14 @@ public CommonQueryContract setParameter(String name, Object value) {
816816
private boolean multipleBinding(QueryParameter<Object> parameter, Object value){
817817
if ( parameter.allowsMultiValuedBinding() ) {
818818
final var hibernateType = parameter.getHibernateType();
819-
if ( hibernateType == null
819+
return hibernateType == null
820+
|| value == null
820821
|| hibernateType instanceof NullSqmExpressible
821-
|| isInstance( hibernateType, value ) ) {
822-
return true;
823-
}
822+
|| isInstance( hibernateType, value );
823+
}
824+
else {
825+
return false;
824826
}
825-
return false;
826827
}
827828

828829
private <T> void setTypedParameter(String name, TypedParameterValue<T> typedValue) {

0 commit comments

Comments
 (0)