Skip to content

Commit d10f735

Browse files
committed
fix: avoid ArrayIndexOutOfBoundsException when currentRow length more than column names length
1 parent b1e195b commit d10f735

File tree

1 file changed

+3
-0
lines changed
  • spring-batch-excel/src/main/java/org/springframework/batch/extensions/excel/support/rowset

1 file changed

+3
-0
lines changed

spring-batch-excel/src/main/java/org/springframework/batch/extensions/excel/support/rowset/DefaultRowSet.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ public Properties getProperties() {
8080
for (int i = 0; i < this.currentRow.length; i++) {
8181
String value = this.currentRow[i];
8282
if (value != null) {
83+
if (i > names.length - 1) {
84+
break;
85+
}
8386
props.setProperty(names[i], value);
8487
}
8588
}

0 commit comments

Comments
 (0)