Merge remote-tracking branch 'lenormf/fix-menu'

This commit is contained in:
Maxime Coste 2018-08-15 00:08:26 +02:00
commit d0709d5f56

View File

@ -1931,6 +1931,9 @@ const CommandDesc menu_cmd = {
Vector<String> select_cmds; Vector<String> select_cmds;
for (int i = 0; i < count; i += modulo) for (int i = 0; i < count; i += modulo)
{ {
if (parser[i].empty())
throw runtime_error(format("entry #{} is empty", i+1));
choices.push_back(markup ? parse_display_line(parser[i], context.faces()) choices.push_back(markup ? parse_display_line(parser[i], context.faces())
: DisplayLine{ parser[i], {} }); : DisplayLine{ parser[i], {} });
commands.push_back(parser[i+1]); commands.push_back(parser[i+1]);