init: missing widget type should not break awesome

This commit is contained in:
Adrian C. (anrxc) 2010-03-13 21:51:40 +01:00
parent febc91dda5
commit 3ac4fcf150
2 changed files with 6 additions and 4 deletions

2
README
View File

@ -477,7 +477,7 @@ Other
----- -----
Read "awesome" manual pages: Read "awesome" manual pages:
awesome(1) awesomerc(5) - awesome(1) awesomerc(5)
Awesome widgets explained: Awesome widgets explained:

View File

@ -103,7 +103,7 @@ local function update(widget, reg, disablecache)
data = c.data data = c.data
else else
data = reg.wtype(reg.format, reg.warg) data = reg.wtype and reg.wtype(reg.format, reg.warg)
end end
if type(data) == "table" then if type(data) == "table" then
@ -242,9 +242,11 @@ end
-- {{{ Enable caching of a widget type -- {{{ Enable caching of a widget type
function cache(wtype) function cache(wtype)
if wtype ~= nil then
if widget_cache[wtype] == nil then if widget_cache[wtype] == nil then
widget_cache[wtype] = {} widget_cache[wtype] = {}
end end
end
end end
-- }}} -- }}}