Commit b086b897 authored by guschilds's avatar guschilds

Issue #2160105 by Proteo: fixed bug with default thumbnail retrieval when video doesn't exist

parent 427d1bb1
...@@ -110,7 +110,12 @@ function youtube_get_remote_image($id = NULL, $force_small = FALSE) { ...@@ -110,7 +110,12 @@ function youtube_get_remote_image($id = NULL, $force_small = FALSE) {
$result = drupal_http_request($url); $result = drupal_http_request($url);
$data = json_decode($result->data); $data = json_decode($result->data);
// Get the high quality default thumbnail. // Get the high quality default thumbnail.
$src = $data->data->thumbnail->hqDefault; if (!empty($data->data)) {
$src = $data->data->thumbnail->hqDefault;
}
else {
$src = youtube_build_remote_image_path($id);
}
} }
// Make the actual request to download the file. // Make the actual request to download the file.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment