From: Stephen Cameron Date: Mon, 26 Aug 2019 08:54:52 +0000 (+0200) Subject: Prevent exception when passing a null `collectionID` to `getImageURLbyCollection... X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=0b3ea2fec5ff5e9146a53d917abe7f0fb2af7868;p=cubist_cms-back.git Prevent exception when passing a null `collectionID` to `getImageURLbyCollection` function. WIP #2738 @0:05 --- diff --git a/src/app/Magic/PageData.php b/src/app/Magic/PageData.php index b7edb4f..3d9b690 100644 --- a/src/app/Magic/PageData.php +++ b/src/app/Magic/PageData.php @@ -288,6 +288,8 @@ class PageData implements \ArrayAccess */ public function getImageURLbyCollection($collectionID, $conversionName = '', $default = null) { + $collectionID = $collectionID ?? ''; + $media = $this->getEntity()->getMedia($collectionID); if (!$media) { return $default;