Skip to content

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

Description

@qiuqinghe

Search before asking

  • I searched in the 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

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions