From 1fc0d81d1a57880682ee962fdacf89a988a5080d Mon Sep 17 00:00:00 2001 From: Nicholas Hairs Date: Sat, 12 Oct 2024 16:21:47 +1100 Subject: [PATCH] [parser] Don't fail on empty auth_results elements Fixes: #41 --- src/parsedmarc/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parsedmarc/parser.py b/src/parsedmarc/parser.py index 4ac1b86..a1274fd 100644 --- a/src/parsedmarc/parser.py +++ b/src/parsedmarc/parser.py @@ -486,7 +486,8 @@ def _parse_aggregate_report_record(self, record: dict) -> dict: else: lowered_from = "" new_record["identifiers"]["header_from"] = lowered_from - if record["auth_results"] is not None: + + if isinstance(record["auth_results"], dict): auth_results = record["auth_results"].copy() if "spf" not in auth_results: auth_results["spf"] = []