]> _ Git - cubist_cms-back.git/commitdiff
Prevent exception when passing a null `collectionID` to `getImageURLbyCollection...
authorStephen Cameron <stephen@cubedesigners.com>
Mon, 26 Aug 2019 08:54:52 +0000 (10:54 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Mon, 26 Aug 2019 08:54:52 +0000 (10:54 +0200)
src/app/Magic/PageData.php

index b7edb4f54ef4b0d077c826d95d84d9cd1a233f0a..3d9b6909049554ccdc40bdf480b5b6d0ab5d5174 100644 (file)
@@ -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;