I'm not the one who posted this, but I got the same issue.
I guess it only happens when the cache is empty and the Inbox is empty, too.
Added
if(threads['resultSizeEstimate']==0):
return [];
before line 61 in gmail_refresh.py.
fixed it for me.
Greetings Badagent