From 7a8e2ad2e6f848098977a78b6cfd8c597df93691 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 10 Jul 2015 12:01:40 -0400 Subject: [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). --- src/leap/mail/adaptors/soledad.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3