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:
parent
50de2174bf
commit
7184ec28cc
@ -71,6 +71,7 @@ class IMAPFolder(BaseFolder):
|
|||||||
# SELECT receives UIDVALIDITY response
|
# SELECT receives UIDVALIDITY response
|
||||||
self.selectro(imapobj)
|
self.selectro(imapobj)
|
||||||
typ, uidval = imapobj.response('UIDVALIDITY')
|
typ, uidval = imapobj.response('UIDVALIDITY')
|
||||||
|
assert uidval != [None], "response('UIDVALIDITY') returned [None]!"
|
||||||
return long(uidval[0])
|
return long(uidval[0])
|
||||||
finally:
|
finally:
|
||||||
self.imapserver.releaseconnection(imapobj)
|
self.imapserver.releaseconnection(imapobj)
|
||||||
|
Loading…
Reference in New Issue
Block a user