Only call task_push_image_load if image exists

This commit is contained in:
twinaphex 2017-01-23 18:30:17 +01:00
parent 5be98cc87c
commit 1437d21457
3 changed files with 8 additions and 5 deletions

View File

@ -1069,6 +1069,8 @@ static int generic_action_ok(const char *path,
strlcpy(settings->path.menu_wallpaper,
action_path, sizeof(settings->path.menu_wallpaper));
if (path_file_exists(action_path))
task_push_image_load(action_path,
menu_display_handle_wallpaper_upload, NULL);
}

View File

@ -1658,7 +1658,7 @@ static void mui_context_reset(void *data)
menu_display_allocate_white_texture();
mui_context_reset_textures(mui);
if (!string_is_empty(settings->path.menu_wallpaper))
if (path_file_exists(settings->path.menu_wallpaper))
task_push_image_load(settings->path.menu_wallpaper,
menu_display_handle_wallpaper_upload, NULL);
}

View File

@ -439,6 +439,7 @@ static void nk_menu_context_reset(void *data)
nk_menu_init_device(nk);
nk_menu_context_load_textures(nk, iconpath);
if (path_file_exists(settings->path.menu_wallpaper))
task_push_image_load(settings->path.menu_wallpaper,
menu_display_handle_wallpaper_upload, NULL);
}