Skip to content

Commit

Permalink
BUG: None-check in DictionaryObject.read_from_stream (py-pdf#1113)
Browse files Browse the repository at this point in the history
Guard pdf.strict with check if pdf is None in DictionaryObject.read_from_stream

Closes py-pdf#1107
  • Loading branch information
jlshin authored and mtd91429 committed Jul 15, 2022
1 parent 2ba30d6 commit d6c3100
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PyPDF2/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ def read_unsized_from_steam(stream: StreamType, pdf: Any) -> bytes: # PdfReader
f"Multiple definitions in dictionary at byte "
f"{hex_str(stream.tell())} for key {key}"
)
if pdf.strict:
if pdf is not None and pdf.strict:
raise PdfReadError(msg)
else:
warnings.warn(msg, PdfReadWarning)
Expand Down

0 comments on commit d6c3100

Please sign in to comment.