nconfig: Fix segfault when menu is empty

nconf crush with segfault if press right arrow in empty menu.

Signed-off-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
Andrej Gelenberg 2010-08-02 11:59:31 +02:00 committed by Michal Marek
parent a64b44ead0
commit 866af407da

View File

@ -676,6 +676,8 @@ static void *item_data(void)
struct mitem *mcur;
cur = current_item(curses_menu);
if (!cur)
return NULL;
mcur = (struct mitem *) item_userptr(cur);
return mcur->usrptr;