Skip to content

Commit

Permalink
Check if pdf variable is None
Browse files Browse the repository at this point in the history
  • Loading branch information
jlshin authored Jul 14, 2022
1 parent bb2d1db commit 3bff9e5
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 3bff9e5

Please sign in to comment.