Browse Source

fix: 空指针异常

pull/3833/head
尤志强 8 months ago
parent
commit
9b03fe431d
  1. 5
      easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvSheet.java

5
easyexcel-core/src/main/java/com/alibaba/excel/metadata/csv/CsvSheet.java

@ -136,9 +136,12 @@ public class CsvSheet implements Sheet, Closeable {
@Override
public Row getRow(int rownum) {
if (rowCache == null) {
return null;
}
int actualRowIndex = rownum - (lastRowIndex - rowCache.size()) - 1;
if (actualRowIndex < 0 || actualRowIndex > rowCache.size() - 1) {
throw new UnsupportedOperationException("The current data does not exist or has been flushed to disk\n.");
return null;
}
return rowCache.get(actualRowIndex);
}

Loading…
Cancel
Save