stand/lua: Don't try to divide by 0; do nothing

This commit is contained in:
Kyle Evans 2018-02-16 22:51:08 +00:00
parent ef62584580
commit aefcaa7e85
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329414

View File

@ -297,9 +297,11 @@ function menu.run(m)
local caridx = menu.getCarouselIndex(carid);
local choices = sel_entry.items();
caridx = (caridx % #choices) + 1;
menu.setCarouselIndex(carid, caridx);
sel_entry.func(choices[caridx]);
if (#choices > 0) then
caridx = (caridx % #choices) + 1;
menu.setCarouselIndex(carid, caridx);
sel_entry.func(choices[caridx]);
end
elseif (sel_entry.entry_type == core.MENU_SUBMENU) then
-- recurse
cont = menu.run(sel_entry.submenu());