summaryrefslogtreecommitdiff
path: root/src/leap/mail
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-01-09 18:11:58 -0400
committerKali Kaneko <kali@leap.se>2014-01-09 18:11:58 -0400
commitbffdcddee55d1045be5d5c8378f712283863b6bf (patch)
tree533d64d92c3ecde7c65f74519ec0fc39f59b3c79 /src/leap/mail
parent772df2393bb8a7efb4260da6675b6eab0d3e0a77 (diff)
check for none
Diffstat (limited to 'src/leap/mail')
-rw-r--r--src/leap/mail/walk.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/leap/mail/walk.py b/src/leap/mail/walk.py
index 820b8c7..dc13345 100644
--- a/src/leap/mail/walk.py
+++ b/src/leap/mail/walk.py
@@ -57,11 +57,13 @@ get_payloads = lambda msg: ((x.get_payload(),
get_body_phash_simple = lambda payloads: first(
[get_hash(payload) for payload, headers in payloads
- if "text/plain" in headers.get('content-type')])
+ if payloads
+ and "text/plain" in headers.get('content-type')])
get_body_phash_multi = lambda payloads: (first(
[get_hash(payload) for payload, headers in payloads
- if "text/plain" in headers.get('content-type')])
+ if payloads
+ and "text/plain" in headers.get('content-type')])
or get_body_phash_simple(payloads))
"""