diff options
author | Bruno Wagner <bwagner@riseup.net> | 2015-11-04 12:10:56 -0200 |
---|---|---|
committer | Bruno Wagner <bwagner@riseup.net> | 2015-12-10 15:38:41 -0200 |
commit | 7d399819f749107cdabdeaeeea330065580434da (patch) | |
tree | 9da5432d1d5bde00ffe4dccc23f0971d2d6a376a /mail/src | |
parent | d012f00e44427bc9f60b84e60a1a80457e84ec8b (diff) |
Fixed the get_body logic
It won't break anymore if the body is None, but will
return an empty body in that case
Diffstat (limited to 'mail/src')
-rw-r--r-- | mail/src/leap/mail/adaptors/soledad.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mail/src/leap/mail/adaptors/soledad.py b/mail/src/leap/mail/adaptors/soledad.py index 8de83f7e..7f2b1cf6 100644 --- a/mail/src/leap/mail/adaptors/soledad.py +++ b/mail/src/leap/mail/adaptors/soledad.py @@ -687,13 +687,14 @@ class MessageWrapper(object): :rtype: deferred """ body_phash = self.hdoc.body - if not body_phash: - if self.cdocs: - return self.cdocs[1] - d = store.get_doc('C-' + body_phash) - d.addCallback(lambda doc: ContentDocWrapper(**doc.content)) - return d - + if body_phash: + d = store.get_doc('C-' + body_phash) + d.addCallback(lambda doc: ContentDocWrapper(**doc.content)) + return d + elif self.cdocs: + return self.cdocs[1] + else: + return '' # # Mailboxes |