Skip to content

Commit

Permalink
Martin's suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Thoma <info@martin-thoma.de>
  • Loading branch information
pubpub-zz and MartinThoma authored Oct 16, 2022
1 parent 4e3478b commit 9b756a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PyPDF2/generic/_data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,11 @@ def _clone(
"""update the object from src"""
self._data = cast("StreamObject", src)._data
try:
if cast("StreamObject", src).decoded_self is None:
decoded_self = cast("StreamObject", src).decoded_self
if decoded_self is None:
self.decoded_self = None
else:
self.decoded_self = cast("StreamObject", src).decoded_self.clone(pdf_dest, True, ignore_fields) # type: ignore
self.decoded_self = decoded_self.clone(pdf_dest, True, ignore_fields) # type: ignore[assignment]
except Exception:
pass
super()._clone(src, pdf_dest, force_duplicate, ignore_fields)
Expand Down

0 comments on commit 9b756a9

Please # to comment.