From 51fd5cfb5a37df4c3f1bdcf77f37420b4b965601 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Jun 2020 09:56:29 -0700 Subject: handle None 'metadata' field correctly --- python/sandcrawler/pdfextract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python') 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() -- cgit v1.2.3