Skip to content

Commit 70debe2

Browse files
authored
Merge pull request #76 from primus852/patch-1
Fixed a PHP Warning
2 parents fa746a5 + 556c8e6 commit 70debe2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Youtube.php

+3
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,9 @@ public function decodeSingle(&$apiData)
554554
}
555555
throw new \Exception($msg, $resObj->error->code);
556556
} else {
557+
if(!property_exists($resObj, 'items')){
558+
return false;
559+
}
557560
$itemsArray = $resObj->items;
558561
if (!is_array($itemsArray) || count($itemsArray) == 0) {
559562
return false;

0 commit comments

Comments
 (0)