Skip to content

Commit

Permalink
Handle case when PdfWriter._sweep_indirect_references returns None.
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Karvonen committed Jul 5, 2022
1 parent 36aa111 commit b17baef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions PyPDF2/_writer.py
Expand Up @@ -926,6 +926,8 @@ def _sweep_indirect_references(
hash_value = None
if newobj is not None:
hash_value = newobj.hash_value()
else:
newobj = NullObject()
# Check if object is already added to pdf.
if hash_value in self._idnum_hash:
newobj_ido = IndirectObject(
Expand Down

0 comments on commit b17baef

Please sign in to comment.