From 556c8e6d9eead1c5f1fcdbadda81579bec4fd41a Mon Sep 17 00:00:00 2001 From: primus852 Date: Fri, 19 Mar 2021 23:05:12 +0100 Subject: [PATCH] Fixed a PHP Warning `Warning: Undefined property: stdClass::$items` --- src/Youtube.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Youtube.php b/src/Youtube.php index 6189506..2ad7500 100644 --- a/src/Youtube.php +++ b/src/Youtube.php @@ -554,6 +554,9 @@ public function decodeSingle(&$apiData) } throw new \Exception($msg, $resObj->error->code); } else { + if(!property_exists($resObj, 'items')){ + return false; + } $itemsArray = $resObj->items; if (!is_array($itemsArray) || count($itemsArray) == 0) { return false;