优化Sax方式读取时空白行返回0,修改为返回-1

This commit is contained in:
Looly 2023-04-27 18:48:59 +08:00
parent fc8df677ca
commit 5d7180c939

View File

@ -189,9 +189,8 @@ public class SheetDataSaxHandler extends DefaultHandler {
*/ */
private void startRow(final Attributes attributes) { private void startRow(final Attributes attributes) {
final String rValue = AttributeName.r.getValue(attributes); final String rValue = AttributeName.r.getValue(attributes);
if (null != rValue) { // https://gitee.com/dromara/hutool/issues/I6WYF6
this.rowNumber = Long.parseLong(rValue) - 1; this.rowNumber = (null == rValue) ? -1 : Long.parseLong(rValue) - 1;
}
} }
/** /**