From 9b997b4e70136394a367fa579d03a0bab0647864 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 28 Jun 2015 17:22:53 +0200 Subject: [PATCH] Handle usecase where a core has no core options --- menu/menu_displaylist.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 01b660ba16..cc5d331be7 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -2379,10 +2379,19 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type) { size_t opts = core_option_size(system->core_options); - for (i = 0; i < opts; i++) + if (opts == 0) + { menu_list_push(info->list, - core_option_get_desc(system->core_options, i), "", - MENU_SETTINGS_CORE_OPTION_START + i, 0, 0); + menu_hash_to_str(MENU_LABEL_VALUE_NO_CORE_OPTIONS_AVAILABLE), "", + MENU_SETTINGS_CORE_OPTION_NONE, 0, 0); + } + else + { + for (i = 0; i < opts; i++) + menu_list_push(info->list, + core_option_get_desc(system->core_options, i), "", + MENU_SETTINGS_CORE_OPTION_START + i, 0, 0); + } } else menu_list_push(info->list,