aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 7acf779..bf54918 100644
--- a/init.lua
+++ b/init.lua
@@ -103,7 +103,7 @@ local function update(widget, reg, disablecache)
data = c.data
else
- data = reg.wtype(reg.format, reg.warg)
+ data = reg.wtype and reg.wtype(reg.format, reg.warg)
end
if type(data) == "table" then
@@ -242,8 +242,10 @@ end
-- {{{ Enable caching of a widget type
function cache(wtype)
- if widget_cache[wtype] == nil then
- widget_cache[wtype] = {}
+ if wtype ~= nil then
+ if widget_cache[wtype] == nil then
+ widget_cache[wtype] = {}
+ end
end
end
-- }}}