summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-07-10 12:01:40 -0400
committerRuben Pollan <meskio@sindominio.net>2015-07-13 11:55:30 -0400
commit7a8e2ad2e6f848098977a78b6cfd8c597df93691 (patch)
treeb33a686848484843852ecb4bb6734dadce63a5ce /src
parent040a5ae5c8ef07251fce19143439b5ff9714b4de (diff)
[bug] Return the first cdoc if no body found
In the case of a message with just one non-text attachment, something has to be returned for the body payload. (For instance, a message with only one image).
Diffstat (limited to 'src')
-rw-r--r--src/leap/mail/adaptors/soledad.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/leap/mail/adaptors/soledad.py b/src/leap/mail/adaptors/soledad.py
index 2b1d2ff..d114707 100644
--- a/src/leap/mail/adaptors/soledad.py
+++ b/src/leap/mail/adaptors/soledad.py
@@ -688,7 +688,8 @@ class MessageWrapper(object):
"""
body_phash = self.hdoc.body
if not body_phash:
- return None
+ if self.cdocs:
+ return self.cdocs[1]
d = store.get_doc('C-' + body_phash)
d.addCallback(lambda doc: ContentDocWrapper(**doc.content))
return d