Prevent crash on pressing up/down when list size is 0 or lower

This commit is contained in:
twinaphex 2015-01-31 04:53:10 +01:00
parent 2bc0b2d3ac
commit 92ad93ea5d

View File

@ -3366,6 +3366,9 @@ static int action_bind_up_or_down_generic(unsigned type, const char *label,
{
unsigned scroll_speed = (max(driver.menu->scroll_accel, 2) - 2) / 4 + 1;
if (menu_list_get_size(driver.menu->menu_list) <= 0)
return 0;
switch (action)
{
case MENU_ACTION_UP: