BUG: check whether self._info is not None before accessing its indirect_reference property#3349
Closed
djangovanderheijden wants to merge 2 commits intopy-pdf:mainfrom
Closed
BUG: check whether self._info is not None before accessing its indirect_reference property#3349djangovanderheijden wants to merge 2 commits intopy-pdf:mainfrom
djangovanderheijden wants to merge 2 commits intopy-pdf:mainfrom
Conversation
…irect_reference property
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3349 +/- ##
==========================================
- Coverage 97.36% 97.35% -0.01%
==========================================
Files 55 55
Lines 9824 9825 +1
Branches 1794 1795 +1
==========================================
Hits 9565 9565
Misses 153 153
- Partials 106 107 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
Thanks for the PR. Please add a corresponding test as well. |
Author
|
Unfortunately I don't have the time to set up and figure out unit testing at this moment. The change is simple enough, so if someone could jump in and help out that'd be great. :) |
stefan6419846
added a commit
to stefan6419846/pypdf
that referenced
this pull request
Jan 26, 2026
stefan6419846
added a commit
to stefan6419846/pypdf
that referenced
this pull request
Jan 26, 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.
I ran into the following error whilst compressing identical objects for a specific input PDF:
After taking a closer look, it seems self._info is usually checked for None throughout the code in _writer.py. This one specific line seems to have slipped through the cracks.