aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-13 21:51:40 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-13 21:51:40 +0100
commit3ac4fcf15056ef392494569a58305e6bd1664d3b (patch)
treeacb66e4bbbe827957ca916c26f310c8206646e33
parentfebc91dda5fe6ceff8ca519d3ac2b98584912e6a (diff)
downloadvicious-legacy-3ac4fcf15056ef392494569a58305e6bd1664d3b.tar.xz
init: missing widget type should not break awesome
-rw-r--r--README2
-rw-r--r--init.lua8
2 files changed, 6 insertions, 4 deletions
diff --git a/README b/README
index e8f7e08..61c6d45 100644
--- a/README
+++ b/README
@@ -477,7 +477,7 @@ Other
-----
Read "awesome" manual pages:
- awesome(1) awesomerc(5)
+ - awesome(1) awesomerc(5)
Awesome widgets explained:
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
-- }}}