Skip to content

Commit

Permalink
BUG: None-check in DictionaryObject.read_from_stream (#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 #1107
  • Loading branch information
jlshin committed Jul 15, 2022
1 parent bb2d1db commit 9bbe827
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PyPDF2/generic.py
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 9bbe827

Please sign in to comment.