From 22350e4e6805fa41284dbaae2cf662cd8ec69765 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 18 Jun 2013 00:24:16 +0200 Subject: menu: Make action callback optional Someone calling menu_show might only be interested in the entry the user selected without having something in the action callback. Make it optional. Signed-off-by: Sascha Hauer --- common/menu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/menu.c b/common/menu.c index d516db4900..ef56190604 100644 --- a/common/menu.c +++ b/common/menu.c @@ -361,7 +361,8 @@ int menu_show(struct menu *m) break; clear(); gotoXY(1,1); - m->selected->action(m, m->selected); + if (m->selected->action) + m->selected->action(m, m->selected); if (m->selected->non_re_ent) return m->selected->num; else -- cgit v1.2.3