From e63e9eba540a2a3ab662ee9e62133c030130cf6c Mon Sep 17 00:00:00 2001 From: Stephen Cameron Date: Mon, 2 Sep 2019 12:12:16 +0200 Subject: [PATCH] Prevent exception when social image isn't set. #2738 @0.25 --- src/app/Magic/PageData.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/Magic/PageData.php b/src/app/Magic/PageData.php index d2a7fa0..ef1334a 100644 --- a/src/app/Magic/PageData.php +++ b/src/app/Magic/PageData.php @@ -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() -- 2.39.5