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

fixed NumberFormatException #107 issue in upstream #108

Closed
wants to merge 1 commit into from

Conversation

bvn13
Copy link

@bvn13 bvn13 commented Aug 24, 2017

No description provided.

@@ -280,7 +280,7 @@ String formattedContents() {
switch(currentCell.getType()) {
case "s": //string stored in shared table
if (!lastContents.isEmpty()) {
int idx = Integer.parseInt(lastContents);
int idx = Integer.parseInt(lastContents.trim());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bvn13 Cool, seems there are lots of issues around malformed SST references out in the wild. I saw some blank ones which is where the if (!lastContents.isEmpty()) came in iirc.

Probably makes sense to change the if-statement from if (!lastContents.isEmpty()) to if (!lastContents.isEmpty() && !lastContents.trim().isEmpty()), so if the value is just whitespace it won't throw a NumberFormatException.

Could you please add a unit test for the failing case? You could probably adapt blank_sst_reference_doctored.xlsx if you don't have a sample you can share. See StreamingReaderTest.testShouldHandleBlankSSTReference() for an example.

@monitorjbl
Copy link
Owner

This PR still needs a unit test before it can be merged

@monitorjbl monitorjbl closed this Apr 27, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants