Skip to content

Commit cd854b2

Browse files
jason-cohenwing328
authored andcommitted
Add check for list size before attempting to set last element field value. (#557)
1 parent 26e70fe commit cd854b2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • modules/openapi-generator/src/main/java/org/openapitools/codegen/languages

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,9 @@ private void removeHeadersFromAllParams(List<CodegenParameter> allParams) {
576576
allParams.add(p);
577577
}
578578
}
579-
allParams.get(allParams.size()-1).hasMore =false;
579+
if (!allParams.isEmpty()) {
580+
allParams.get(allParams.size()-1).hasMore =false;
581+
}
580582
}
581583

582584
@Override

0 commit comments

Comments
 (0)