Skip to content

Commit

Permalink
BUG: 'PdfFileWriter' object has no attribute 'stream'
Browse files Browse the repository at this point in the history
Closes #670
  • Loading branch information
MartinThoma committed Apr 20, 2022
1 parent e7fe707 commit b1a2526
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PyPDF2/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ def _sweepIndirectReferences(self, externMap, data):
self._sweepIndirectReferences(externMap, realdata)
return data
else:
if data.pdf.stream.closed:
if hasattr(data.pdf, "stream") and data.pdf.stream.closed:
raise ValueError("I/O operation on closed file: {}".format(data.pdf.stream.name))
newobj = externMap.get(data.pdf, {}).get(data.generation, {}).get(data.idnum, None)
if newobj is None:
Expand Down

0 comments on commit b1a2526

Please sign in to comment.