summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank LENORMAND <lenormf@gmail.com>2018-08-11 10:03:55 +0300
committerFrank LENORMAND <lenormf@gmail.com>2018-08-11 10:03:57 +0300
commit97abfd403d4d7a9e663d965cb670df90d6056a53 (patch)
treeb687b72bbbb1373933804ba1891f9d210f83a327 /src
parent983a8f759a3a959c7712891e2180ab5357c139d2 (diff)
src: Forbid empty `menu` entries
Empty entries in menus look weird, and don't serve any purpose. Empty commands are still allowed.
Diffstat (limited to 'src')
-rw-r--r--src/commands.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/commands.cc b/src/commands.cc
index dcee0281..b249b476 100644
--- a/src/commands.cc
+++ b/src/commands.cc
@@ -1931,6 +1931,9 @@ const CommandDesc menu_cmd = {
Vector<String> select_cmds;
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())
: DisplayLine{ parser[i], {} });
commands.push_back(parser[i+1]);