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

handle fields with no /Type set #356

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

cip91sk
Copy link

@cip91sk cip91sk commented Dec 13, 2023

Description of the changes

Prevents a KeyError bubbling up if the '/Type' key is not set in a field definition

Checklist

Please go over this checklist to increase the chances of your PR being worked on in a timely manner. Deviations are allowed with proper justification (see previous section).

  • I have read the project's CoC and contribution guidelines.
  • I understand and agree to the terms in the Developer Certificate of Origin as applied to this contribution.
  • All new code in this PR has full test coverage.

For bug fixes (delete if not applicable)

  • My changes do not affect any public API or CLI semantics.
  • My PR adds regression tests (i.e. tests that fail if the bug fix is not applied).
  • All new code in this PR has full test coverage.

Additional comments

While extracting signature info from files received from a third party, pyHanko failed on me with the KeyError Exception while trying to raw_get '/Type'.
I apologise if I missed something in the PR, and while I'm here, thank you for your great work!

@MatthiasValvekens
Copy link
Owner

Hi @cip91sk, thanks for this bugfix! I've added a regression test. Will merge this when the CI workflows pass.

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5f9ac0f) 98.83% compared to head (8e4185f) 98.83%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #356   +/-   ##
=======================================
  Coverage   98.83%   98.83%           
=======================================
  Files         113      113           
  Lines       16289    16289           
=======================================
  Hits        16099    16099           
  Misses        190      190           
Flag Coverage Δ
unittests 98.83% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@MatthiasValvekens MatthiasValvekens merged commit 642be7f into MatthiasValvekens:master Dec 13, 2023
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.

2 participants