Avoid crash in search if no results
I am incluiding this check to avoid crash if the array is empty and we are trying to read the first element.
This commit is contained in:
parent
ca0a2651a3
commit
0fe1caa6a5
@ -238,7 +238,7 @@ class IMAPFolder(BaseFolder):
|
|||||||
|
|
||||||
# Then, I can do the check in the same way than Python 2
|
# Then, I can do the check in the same way than Python 2
|
||||||
# with string comparison:
|
# with string comparison:
|
||||||
if ' ' in res_data[0] or res_data[0] == '':
|
if len(res_data) > 0 and (' ' in res_data[0] or res_data[0] == ''):
|
||||||
res_data = res_data[0].split()
|
res_data = res_data[0].split()
|
||||||
# Some servers are broken.
|
# Some servers are broken.
|
||||||
if 0 in res_data:
|
if 0 in res_data:
|
||||||
|
Loading…
Reference in New Issue
Block a user