Sanity check return value of UIDVALIDTY response

We have a reported case where response('UIDVALIDITY') returned [None]
which results in an ugly non-intuitive crash. Sanity check and report
something nicer.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2012-01-08 12:26:47 +01:00
parent 50de2174bf
commit 7184ec28cc

View File

@ -71,6 +71,7 @@ class IMAPFolder(BaseFolder):
# SELECT receives UIDVALIDITY response
self.selectro(imapobj)
typ, uidval = imapobj.response('UIDVALIDITY')
assert uidval != [None], "response('UIDVALIDITY') returned [None]!"
return long(uidval[0])
finally:
self.imapserver.releaseconnection(imapobj)