Skip to content

Commit

Permalink
ROBUST: title sometimes None (#744)
Browse files Browse the repository at this point in the history
Closes #511
  • Loading branch information
clach04 committed Apr 15, 2022
1 parent 012709f commit 29194cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PyPDF2/pdf.py
Expand Up @@ -2896,7 +2896,7 @@ def getText(self, key):
return retval
return None

title = property(lambda self: self.getText("/Title"))
title = property(lambda self: self.getText("/Title") or self.get("/Title").getObject() if self.get("/Title") else None)
"""Read-only property accessing the document's **title**.
Returns a unicode string (``TextStringObject``) or ``None``
if the title is not specified."""
Expand Down

0 comments on commit 29194cd

Please sign in to comment.