Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

读取空行时越界 #116

Open
skiloop opened this issue May 30, 2024 · 0 comments
Open

读取空行时越界 #116

skiloop opened this issue May 30, 2024 · 0 comments

Comments

@skiloop
Copy link

skiloop commented May 30, 2024

版本:1.4.7

我遇到了一个案例,表格结尾几行没有单元格导致越界异常。
ExcelImportServer.java的133行importExcel函数

int firstCellNum = row.getFirstCellNum();
                    if (firstCellNum > minColumnIndex) {
                        firstCellNum = minColumnIndex;
                    }

                    int lastCellNum = row.getLastCellNum();
                    if (lastCellNum < maxColumnIndex + 1) {
                        lastCellNum = maxColumnIndex + 1;
                    }

                    int i = firstCellNum;

                    for(int le = lastCellNum; i < le; ++i) {
                        Cell cell = row.getCell(i);

因为没有单元格,getFirstCellNum返回-1, 导致Cell cell = row.getCell(i);发生越界异常。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant