From bffdcddee55d1045be5d5c8378f712283863b6bf Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 9 Jan 2014 18:11:58 -0400 Subject: check for none --- src/leap/mail/walk.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/leap') 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)) """ -- cgit v1.2.3