awful.menu: fix error when using the keyboard to navigate on an empty menu

Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Gregor Best 2009-03-30 23:45:29 +02:00 committed by Julien Danjou
parent b437db6ab0
commit e9acefa24e
1 changed files with 3 additions and 0 deletions

View File

@ -97,6 +97,9 @@ end
local function exec(menu, num, mouse_event)
cmd = menu.items[num].cmd
if type(cmd) == "table" then
if #cmd == 0 then
return
end
if not menu.child[num] then
menu.child[num] = new({ items = cmd }, menu, num)
end