Skip to content

Commit d9310c2

Browse files
cigalybeikov
authored andcommitted
HHH-19719 Prevent IndexOutOfBoundsException when no arguments
1 parent 50c84ed commit d9310c2

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
@@ -144,7 +144,7 @@ public void appendHqlString(StringBuilder sb) {
144144
sb.append( getFunctionName() );
145145
sb.append( '(' );
146146
int i = 1;
147-
if ( arguments.get( 0 ) instanceof SqmDistinct<?> ) {
147+
if ( !arguments.isEmpty() && arguments.get( 0 ) instanceof SqmDistinct<?> ) {
148148
arguments.get( 0 ).appendHqlString( sb );
149149
if ( arguments.size() > 1 ) {
150150
sb.append( ' ' );

0 commit comments

Comments
 (0)