summaryrefslogtreecommitdiff
path: root/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
commitae17b3b8d4b032e7fd09f2f99553296ad8eb3876 (patch)
tree136314a03b146f372cec08ffce8622a09900c1df /mail
parent3e447f6e281313de5926e1438ccff64bb298e879 (diff)
check for none
Diffstat (limited to 'mail')
-rw-r--r--mail/changes/bug_4933_check_for_none1
-rw-r--r--mail/src/leap/mail/walk.py6
2 files changed, 5 insertions, 2 deletions
diff --git a/mail/changes/bug_4933_check_for_none b/mail/changes/bug_4933_check_for_none
new file mode 100644
index 0000000..33f3bd5
--- /dev/null
+++ b/mail/changes/bug_4933_check_for_none
@@ -0,0 +1 @@
+ o Check for none in payload detection. Closes: #4933
diff --git a/mail/src/leap/mail/walk.py b/mail/src/leap/mail/walk.py
index 820b8c7..dc13345 100644
--- a/mail/src/leap/mail/walk.py
+++ b/mail/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))
"""