Skip to content

Commit

Permalink
API: API response of null, fixed to empty array.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Sep 13, 2019
1 parent 8acf1a0 commit c9138b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/VimeoVideoAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public function getInfo(int $token): VideoInfo
curl_setopt($ch = curl_init(), CURLOPT_URL, 'https://vimeo.com/api/oembed.json?url=https:%2F%2Fvimeo.com%2F' . $token);
curl_setopt($ch, CURLOPT_REFERER, $this->referer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$cache[$token] = new VideoInfo(json_decode(curl_exec($ch), true));
$cache[$token] = new VideoInfo(json_decode(curl_exec($ch), true) ?? []);
curl_close($ch);
}

return $cache[$token];
}

}
}

0 comments on commit c9138b1

Please sign in to comment.