]> _ Git - cubist_cms-back.git/commitdiff
Prevent exception when social image isn't set. #2738 @0.25
authorStephen Cameron <stephen@cubedesigners.com>
Mon, 2 Sep 2019 10:12:16 +0000 (12:12 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Mon, 2 Sep 2019 10:12:16 +0000 (12:12 +0200)
src/app/Magic/PageData.php

index d2a7fa00180757721f80dd9e7665bd90a8e24681..ef1334a1c27901107af9b81621096d0597b3bc8f 100644 (file)
@@ -32,7 +32,13 @@ class PageData extends EntityData
     public function getSocialImage()
     {
         $settings = Settings::getData();
-        return url($this->getImageURL('social_image','', $settings->getImageURL('social_image')));
+        $image = $this->getImageURL('social_image','', $settings->getImageURL('social_image'));
+
+        if (!$image) {
+            return null;
+        }
+
+        return url($image);
     }
 
     public function getRobots()