aboutsummaryrefslogtreecommitdiff
path: root/widgets/gmail.lua
diff options
context:
space:
mode:
authorBenoƮt Zugmeyer <bzugmeyer@gmail.com>2014-11-16 03:24:53 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2014-11-19 00:40:56 +0100
commit5869a54b201cd30988618025e63ceaa4df69d927 (patch)
tree368f436be551e5636194c153e0a4da2a60ea3f65 /widgets/gmail.lua
parent336ce9bbd7c620226d0ef01ba58c02be12f7b90e (diff)
downloadvicious-legacy-5869a54b201cd30988618025e63ceaa4df69d927.tar.xz
gmail: fix error when gmail.com is unreachable
ex: no internet connection Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Diffstat (limited to 'widgets/gmail.lua')
-rw-r--r--widgets/gmail.lua4
1 files changed, 4 insertions, 0 deletions
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, "<fullcount>([%d]+)</fullcount>")) or mail["{count}"]