Skip to content

Commit a2f311d

Browse files
cigalybeikov
authored andcommitted
HHH-19719 Prevent IndexOutOfBoundsException when no arguments
1 parent cda93c6 commit a2f311d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hibernate-core/src/main/java/org/hibernate/query/sqm/function/SelfRenderingSqmWindowFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void appendHqlString(StringBuilder hql, SqmRenderContext context) {
121121
hql.append( getFunctionName() );
122122
hql.append( '(' );
123123
int i = 1;
124-
if ( arguments.get( 0 ) instanceof SqmDistinct<?> ) {
124+
if ( !arguments.isEmpty() && arguments.get( 0 ) instanceof SqmDistinct<?> ) {
125125
arguments.get( 0 ).appendHqlString( hql, context );
126126
if ( arguments.size() > 1 ) {
127127
hql.append( ' ' );

0 commit comments

Comments
 (0)