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

fix: [#465] Avoid NPE with missing 'r' attribute #514

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ursjoss
Copy link

@ursjoss ursjoss commented Feb 19, 2025

Fixes #465

For the case the (optional) r attribute is not present, the code tracks the running line and column number, falling back to those if the r attribute does not provide the proper addresses.

Adds a test case (issue514.xlsx), that fails being processed (with the reported NPE) and passes with the fix.

Please note: The file that was provided by the ticket reporter @fabiospiga has different issues in addition to the reported NPE. The fix of this PR does help to not throw the reported NPE also for that file, but it does not address the other issues (I tried with a time-box but failed to get it fully processed). The PR let's us process the file that brought us to this ticket in the first place.

Inspired by the apache poi approach, see code here.

This PR is now complete IMHO and ready to be reviewed.

Tracks both row and column indices to allow falling back to those
to determine row and/or cell address for Excel files that do not
provide the (optional) reference attribute 'r'.

Inspired by the apache poi approach.
@ursjoss ursjoss force-pushed the fix/465-handle-missing-r-attribute branch from 013d104 to a7fa9fc Compare February 20, 2025 11:55
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.

Error on reading files where <c> element misses the "r" attribute
1 participant