gmail: fix error when gmail.com is unreachable

ex: no internet connection

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
This commit is contained in:
Benoît Zugmeyer 2014-11-16 03:24:53 +01:00 committed by Adrian C. (anrxc)
parent 336ce9bbd7
commit 5869a54b20
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,10 @@ local function worker(format, warg)
-- Could be huge don't read it all at once, info we are after is at the top
local xml = f:read(2000)
if xml ~= nil then
return mail
end
mail["{count}"] = -- Count comes before messages and matches at least 0
tonumber(string.match(xml, "<fullcount>([%d]+)</fullcount>")) or mail["{count}"]