diff options
-rw-r--r-- | src/leap/mail/mailbox_indexer.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/leap/mail/mailbox_indexer.py b/src/leap/mail/mailbox_indexer.py index 3bec41e..732a6ee 100644 --- a/src/leap/mail/mailbox_indexer.py +++ b/src/leap/mail/mailbox_indexer.py @@ -30,7 +30,7 @@ def _maybe_first_query_item(thing): """ try: return thing[0][0] - except IndexError: + except (TypeError, IndexError): return None @@ -280,10 +280,7 @@ class MailboxIndexer(object): check_good_uuid(mailbox_uuid) def increment(result): - uid = _maybe_first_query_item(result) - if uid is None: - return 1 - return uid + 1 + return result + 1 d = self.get_last_uid(mailbox_uuid) d.addCallback(increment) |