From 944854d29b5b85aaa0165a3b86203d7cea3a879d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6rner?= Date: Thu, 12 Jun 2025 09:01:26 +0200 Subject: [PATCH] catch runtime exception --- src/SocialFeed/SocialFeedNewsClass.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/SocialFeed/SocialFeedNewsClass.php b/src/SocialFeed/SocialFeedNewsClass.php index 39c7d13..2487b16 100644 --- a/src/SocialFeed/SocialFeedNewsClass.php +++ b/src/SocialFeed/SocialFeedNewsClass.php @@ -23,6 +23,7 @@ use Contao\FilesModel; use Contao\StringUtil; use Contao\System; +use Imagine\Exception\RuntimeException; use Pdir\SocialFeedBundle\Model\SocialFeedModel; class SocialFeedNewsClass @@ -66,7 +67,11 @@ public function parseNews($objTemplate, $arrRow, $objModule): void } if (null !== $imagePath) { - $pictureObj = $pictureFactory->create($this->projectDir.DIRECTORY_SEPARATOR.$imagePath); + try { + $pictureObj = $pictureFactory->create($this->projectDir.DIRECTORY_SEPARATOR.$imagePath); + } catch (RuntimeException) { + $pictureObj = null; + } if (null !== $pictureObj) { $objTemplate->accountPicture = $this->getTemplateData($pictureObj);