summaryrefslogtreecommitdiff
path: root/src/leap
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
commit52868a4c67170abbfa19deda9bd20931c21554b7 (patch)
treed6e330d619483bc41e1e4915c6d1969c07060c45 /src/leap
parent4bcb32639bff9a5aab076dba2bdc7667cea60c7f (diff)
catch stopiteration
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/mail/imap/soledadstore.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/leap/mail/imap/soledadstore.py b/src/leap/mail/imap/soledadstore.py
index e047e2e..25f00bb 100644
--- a/src/leap/mail/imap/soledadstore.py
+++ b/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))