summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-02-20 01:21:46 -0400
committerKali Kaneko <kali@leap.se>2014-02-20 11:50:10 -0400
commitb0bbedcb041c2e13c3cb7f989c3c7dadd8f28257 (patch)
tree37dc52020477761cb00b77fcf4c3bb783375cfab /mail
parent7324138407055efcb7863b24661dcb348aa67ae3 (diff)
catch stopiteration
Diffstat (limited to 'mail')
-rw-r--r--mail/src/leap/mail/imap/soledadstore.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/mail/src/leap/mail/imap/soledadstore.py b/mail/src/leap/mail/imap/soledadstore.py
index e047e2e9..25f00bb9 100644
--- a/mail/src/leap/mail/imap/soledadstore.py
+++ b/mail/src/leap/mail/imap/soledadstore.py
@@ -281,9 +281,13 @@ class SoledadStore(ContentDedup):
def doSoledadCalls(items):
# we prime the generator, that should return the
# message or flags wrapper item in the first place.
- doc_wrapper = items.next()
- failed = self._soledad_write_document_parts(items)
- queueNotifyBack(failed, doc_wrapper)
+ try:
+ doc_wrapper = items.next()
+ except StopIteration:
+ pass
+ else:
+ failed = self._soledad_write_document_parts(items)
+ queueNotifyBack(failed, doc_wrapper)
doSoledadCalls(self._iter_wrapper_subparts(doc_wrapper))