Repository navigation
ROB: Do not crash when the page resources are not a dictionary - #4054
Merged
stefan6419846 merged 2 commits intoSep 8, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4054 +/- ##
==========================================
+ Coverage 98.09% 98.10% +0.01%
==========================================
Files 58 59 +1
Lines 11394 11473 +79
Branches 2138 2147 +9
==========================================
+ Hits 11177 11256 +79
Misses 122 122
Partials 95 95 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefan6419846
requested changes
Sep 7, 2026
stefan6419846
left a comment
Collaborator
There was a problem hiding this comment.
The coverage is incomplete (is_null_or_none not covered).
stefan6419846
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
extract_text casts the inherited /Resources into a dictionary and then tests
"/Font" in it, so a page whose /Resources is a number, a string or an array
crashes with "argument of type 'NumberObject' is not iterable" rather than
returning no text.
The lookup moved into a small helper that logs and returns an empty
dictionary, which gives the same result as a page with no resources at all.
Keeping it in a helper also avoids pushing _extract_text past the complexity
limit.
I could not run the tests that download the corpus locally; the offline suite
passes, 1283 tests.
Used Claude (Opus) to help locate and patch this; I reviewed and tested the change.