aboutsummaryrefslogtreecommitdiff
path: root/widgets/mbox.lua
diff options
context:
space:
mode:
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")