awful.menu: check there's at least one item

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-12-29 17:20:33 +01:00
parent d6dbb00f10
commit ee1e63009b
1 changed files with 1 additions and 1 deletions

View File

@ -231,7 +231,7 @@ end
--- Toggle menu visibility.
-- @param menu The menu to show if it's hidden, or to hide if it's shown.
function toggle(menu)
if menu.items[1].screen then
if menu.items[1] and menu.items[1].screen then
hide(menu)
else
show(menu)