From 5869a54b201cd30988618025e63ceaa4df69d927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Zugmeyer?= Date: Sun, 16 Nov 2014 03:24:53 +0100 Subject: gmail: fix error when gmail.com is unreachable ex: no internet connection Signed-off-by: Adrian C. (anrxc) --- widgets/gmail.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widgets/gmail.lua b/widgets/gmail.lua index dbd7d19..84f2125 100644 --- a/widgets/gmail.lua +++ b/widgets/gmail.lua @@ -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, "([%d]+)")) or mail["{count}"] -- cgit v1.2.3