summaryrefslogtreecommitdiff
path: root/mail/src/leap
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-11-26 16:46:58 -0200
committerKali Kaneko <kali@leap.se>2013-11-26 17:20:53 -0200
commitb10d7a72cb96df2d563d90ab1811e24aa2fa84ab (patch)
treebaef89bce7d828ac7ab5293baa9246b750444039 /mail/src/leap
parenta2e5041f87716d10e28e97428188e29506f2e089 (diff)
Fix fetch iteration on empty folder
Diffstat (limited to 'mail/src/leap')
-rw-r--r--mail/src/leap/mail/imap/server.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mail/src/leap/mail/imap/server.py b/mail/src/leap/mail/imap/server.py
index bb2830d9..abe1dfa2 100644
--- a/mail/src/leap/mail/imap/server.py
+++ b/mail/src/leap/mail/imap/server.py
@@ -1512,7 +1512,10 @@ class SoledadMailbox(WithMsgFields):
except TypeError:
# looks like we cannot iterate
last = self.messages.get_last()
- uid_last = last.getUID()
+ if last is None:
+ uid_last = 1
+ else:
+ uid_last = last.getUID()
messages.last = uid_last
# for sequence numbers (uid = 0)