Ephoto: Fix a potential crash when switching directories in single view.

This commit is contained in:
Stephen 'Okra' Houston 2017-05-05 11:08:15 -05:00
parent e53ee13f3c
commit 5759135ad3
1 changed files with 11 additions and 3 deletions

View File

@ -2142,10 +2142,18 @@ ephoto_single_browser_entries_set(Evas_Object *obj, Eina_List *entries)
elm_image_file_get(v->image, &image, NULL); elm_image_file_get(v->image, &image, NULL);
dir = ecore_file_dir_get(image); dir = ecore_file_dir_get(image);
if (strcmp(sb->ephoto->config->directory, dir)) if (!dir)
ephoto_single_browser_entry_set(sb->main, {
ephoto_single_browser_entry_set(sb->main,
_first_entry_find(sb)); _first_entry_find(sb));
free(dir); }
else
{
if (strcmp(sb->ephoto->config->directory, dir))
ephoto_single_browser_entry_set(sb->main,
_first_entry_find(sb));
free(dir);
}
} }
else else
ephoto_single_browser_entry_set(sb->main, ephoto_single_browser_entry_set(sb->main,