summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/menu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/menu.c b/common/menu.c
index b577d80b4ff..f5fc6930a2c 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -271,6 +271,9 @@ int menu_get_choice(struct menu *m, void **choice)
if (!m || !choice)
return -EINVAL;
+ if (!m->item_cnt)
+ return -ENOENT;
+
if (!m->prompt)
return menu_default_choice(m, choice);