Skip to content

Commit 29194cd

Browse files
authored
ROBUST: title sometimes None (#744)
Closes #511
1 parent 012709f commit 29194cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PyPDF2/pdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2896,7 +2896,7 @@ def getText(self, key):
28962896
return retval
28972897
return None
28982898

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

0 commit comments

Comments
 (0)