fix crash when activating menu that is not in range
Summary: add the condition check code if the pressed key is not in range of menu items Test Plan: (1) Left-click on the desktop to bring up the menu. (2) Press down the number key to activate the menu item. (3) When you press down the number key that is not in range, you will see the segmentation error. below is the crash log which I encoutered. ------------------------------------------------------------------- Program received signal SIGSEGV, Segmentation fault. _e_menu_item_activate_nth (n=n@entry=5) at src/bin/e_menu.c:2318 2318 _e_menu_item_ensure_onscreen(mi); Reviewers: zmike, gwanglim, raster Reviewed By: raster Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1845
This commit is contained in:
parent
82d3a7aa31
commit
fea82f6a78
|
@ -2386,6 +2386,7 @@ _e_menu_item_activate_nth(int n)
|
|||
if (!mi->separator) i++;
|
||||
if (i == n) break;
|
||||
}
|
||||
if (!mi) return;
|
||||
e_menu_item_active_set(mi, 1);
|
||||
_e_menu_item_ensure_onscreen(mi);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue