Skip to content

Commit

Permalink
Fixed: non exists variable
Browse files Browse the repository at this point in the history
  • Loading branch information
JanGalek committed Jul 17, 2017
1 parent 7681347 commit 0b26841
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/TroiaStudio/Utils/Youtube-API/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,7 @@ private function createVideo($data, $videoId)
$json = Nette\Utils\Json::decode($data);

if (!isset($json->items[0]->snippet) || !isset($json->items[0]->contentDetails) || !isset($json->items[0]->status) || !isset($json->items[0]->statistics)) {
if ($exception) {
throw new \RuntimeException("Empty YouTube response, probably wrong '{$videoId}' video id.");
} else {
$this->videos[$videoId] = new Video;
}
throw new \RuntimeException("Empty YouTube response, probably wrong '{$videoId}' video id.");
}

$snippet = $json->items[0]->snippet;
Expand Down

0 comments on commit 0b26841

Please sign in to comment.