Skip to content

Conversation

@joshkersey
Copy link
Contributor

This PR prevents PdfWriter.merge()/append() from crashing when a source PDF’s catalog contains an /AcroForm entry that is present but null (or resolves to null). A regression test is included.

Closes #3598

@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.35%. Comparing base (26fd638) to head (3a84a66).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3601   +/-   ##
=======================================
  Coverage   97.35%   97.35%           
=======================================
  Files          55       55           
  Lines        9816     9816           
  Branches     1792     1792           
=======================================
  Hits         9556     9556           
  Misses        153      153           
  Partials      107      107           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefan6419846 stefan6419846 changed the title BUG: Avoid crash when /AcroForm is null during merge ROB: /AcroForm might be NullObject Jan 15, 2026
Copy link
Collaborator

@stefan6419846 stefan6419846 left a comment

Choose a reason for hiding this comment

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

Thanks.

@stefan6419846 stefan6419846 merged commit 4740225 into py-pdf:main Jan 15, 2026
19 checks passed
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.

PdfWriter().merge() raising TypeError for some PDFs due to NullObject AcroForm

2 participants