Author: kevans Date: Fri Feb 16 22:51:08 2018 New Revision: 329414 URL: https://svnweb.freebsd.org/changeset/base/329414
Log: stand/lua: Don't try to divide by 0; do nothing Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 22:17:30 2018 (r329413) +++ head/stand/lua/menu.lua Fri Feb 16 22:51:08 2018 (r329414) @@ -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()); _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"