Fix crash when selecting 'Scan Directory'

This commit is contained in:
twinaphex 2017-09-28 16:29:45 +02:00
parent c828a425e7
commit 97f821e743
1 changed files with 5 additions and 1 deletions

View File

@ -735,7 +735,7 @@ static int general_push(menu_displaylist_info_t *info,
break; break;
case PUSH_DEFAULT: case PUSH_DEFAULT:
{ {
char *new_exts = info->exts; char *new_exts = NULL;
if (menu_setting_get_browser_selection_type(info->setting) == ST_DIR) if (menu_setting_get_browser_selection_type(info->setting) == ST_DIR)
{ {
@ -751,6 +751,10 @@ static int general_push(menu_displaylist_info_t *info,
new_exts = strdup(system->valid_extensions); new_exts = strdup(system->valid_extensions);
} }
if (!new_exts)
new_exts = info->exts;
if (new_exts && !string_is_empty(new_exts))
{ {
union string_list_elem_attr attr; union string_list_elem_attr attr;
size_t path_size = PATH_MAX_LENGTH * sizeof(char); size_t path_size = PATH_MAX_LENGTH * sizeof(char);