aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoƮt Zugmeyer <bzugmeyer@gmail.com>2014-11-16 02:24:53 (GMT)
committerAdrian C. (anrxc) <anrxc@sysphere.org>2014-11-18 23:40:56 (GMT)
commit5869a54b201cd30988618025e63ceaa4df69d927 (patch)
tree368f436be551e5636194c153e0a4da2a60ea3f65
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>
-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}"]