summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2015-11-16 20:21:31 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2015-11-16 20:22:05 +0200
commit125332508ff83acb7f0240f6d1f32db68a2d03aa (patch)
treec4df3ea6c57fae66d2e9716bb0befa7ae4726d0b
parentc1494beea27f2140ef059c95f139ae3007c355aa (diff)
Fix reading PDF's with no metadata
-rw-r--r--lekha/app.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lekha/app.py b/lekha/app.py
index d5cc968..f4e0194 100644
--- a/lekha/app.py
+++ b/lekha/app.py
@@ -435,7 +435,12 @@ class Document(Table):
435 info = self.doc.getDocumentInfo() 435 info = self.doc.getDocumentInfo()
436 except Exception: 436 except Exception:
437 log.warn("Metadata information could not be extracted from the document") 437 log.warn("Metadata information could not be extracted from the document")
438 return
438 else: 439 else:
440 if not info:
441 log.warn("Metadata information could not be extracted from the document")
442 return
443
439 log.info( 444 log.info(
440 "%s %s %s %s %s", 445 "%s %s %s %s %s",
441 info.title, info.author, info.subject, info.creator, info.producer) 446 info.title, info.author, info.subject, info.creator, info.producer)