aboutsummaryrefslogtreecommitdiff
path: root/widgets/mbox.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-14 03:37:40 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-14 03:37:40 +0100
commit4dad2e360c1c464feef9a8aaff6e96a7636c54b7 (patch)
tree03290f705cef2ec761a0a1ee46b3bc38cb08e0ea /widgets/mbox.lua
parent237470c8f45190b213e3a173ce6ae1a74b3e11fe (diff)
downloadvicious-legacy-4dad2e360c1c464feef9a8aaff6e96a7636c54b7.tar.xz
API: missing warg should not break awesome
Diffstat (limited to 'widgets/mbox.lua')
-rw-r--r--widgets/mbox.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/widgets/mbox.lua b/widgets/mbox.lua
index eca5403..efd3a42 100644
--- a/widgets/mbox.lua
+++ b/widgets/mbox.lua
@@ -18,9 +18,11 @@ module("vicious.widgets.mbox")
-- {{{ Mailbox widget type
local function worker(format, warg)
- if type(warg) ~= "table" then mbox = warg end
+ if not warg then return end
+
-- mbox could be huge, get a 30kb chunk from EOF
- -- * attachments could be much bigger than this
+ if type(warg) ~= "table" then mbox = warg end
+ -- * attachment could be much bigger than 30kb
local f = io.open(mbox or warg[1])
f:seek("end", -30720)
local txt = f:read("*all")