diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-06-26 09:56:29 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-06-26 09:56:29 -0700 |
commit | 51fd5cfb5a37df4c3f1bdcf77f37420b4b965601 (patch) | |
tree | 13644c9a96f55dfe8d16ef92f91b5763d249e360 /python | |
parent | f766aa742dee0b3937a432e3afc4cc48250b1d09 (diff) | |
download | sandcrawler-51fd5cfb5a37df4c3f1bdcf77f37420b4b965601.tar.gz sandcrawler-51fd5cfb5a37df4c3f1bdcf77f37420b4b965601.zip |
handle None 'metadata' field correctly
Diffstat (limited to 'python')
-rw-r--r-- | python/sandcrawler/pdfextract.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/sandcrawler/pdfextract.py b/python/sandcrawler/pdfextract.py index 3701172..5f9b898 100644 --- a/python/sandcrawler/pdfextract.py +++ b/python/sandcrawler/pdfextract.py @@ -78,7 +78,7 @@ class PdfExtractResult: return PdfExtractResult( sha1hex=record['sha1hex'], status=record['status'], - error_msg=record.get('metadata', {}).get('error_msg'), + error_msg=(record.get('metadata') or {}).get('error_msg'), ) else: pdf_extra = dict() |