diff --git a/tasks/task_pl_thumbnail_download.c b/tasks/task_pl_thumbnail_download.c index a1ddef71e4..beddb02e54 100644 --- a/tasks/task_pl_thumbnail_download.c +++ b/tasks/task_pl_thumbnail_download.c @@ -243,6 +243,13 @@ void cb_http_task_download_pl_thumbnail( if (!data || !data->data || string_is_empty(transf->path)) goto finish; + /* Skip if data can't be good */ + if (data->status != 200) + { + err = "File not found."; + goto finish; + } + /* Create output directory, if required */ strlcpy(output_dir, transf->path, sizeof(output_dir)); path_basedir_wrapper(output_dir); @@ -253,13 +260,6 @@ void cb_http_task_download_pl_thumbnail( goto finish; } - /* Skip if data can't be good */ - if (data->status != 200) - { - err = "File not found."; - goto finish; - } - /* Write thumbnail file to disk */ if (!filestream_write_file(transf->path, data->data, data->len)) {