apache / apache/fesod

[Bug] CellTagHandler line 70, Integer.parseInt caused exception when reading one excel.

Open
#355 5 comments 0 reactions 0 assignees View on GitHub
bug question
Dominant language
Java
Stars
6.2k
Forks
532
Avg merge
1d 3h
Merged PRs (30d)
42

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/fast-excel/fastexcel/issues) and found nothing similar.

### Fastexcel version

1.2.0

### JDK version

1.8

### Operating system

Win 10

### Minimal reproduce step

In my intranet environment, there is one particular cell in one excel. When using fastexcel to read this excel, and read this problem cell, it caused NumberFormatException.

Exception in thread "main" java.ang.umberFormatException create breakpoint : For input string: "function toString() { [native code] f'at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)at java.lang.Integer.parseInt(Integer.java:580)at java.lang.Integer.value0f(Integer.java:766)
at cn.idev.excel.analysis.v07.handlers.CellTagHandler.endElement(CellTagHandler.java:70)
at cn.idey.excel,analysis,.v07.handlers,sax,XlsxRowHandler,endElement(XlsxRowHandler,iava:99)

Suggestion:
In CellTagHandler.java, line 70, add try ... catch for Integer.parseInt

![Image](https://github.com/user-attachments/assets/9b02c4ad-3040-4f24-8589-51f1a6c372c6)

### What did you expect to see?

Read the whole excel.

### What did you see instead?

The reading process broke, didn't read the whole content inside excel.

### Anything else?

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.