From: Hypolite Petovan Date: Mon, 3 Apr 2023 04:05:40 +0000 (-0400) Subject: Ward against nonexistant item in Item::prepareBody X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e7628af15ff4cf50ba23c064dacd610618ffdd5d;p=friendica.git Ward against nonexistant item in Item::prepareBody - Address https://github.com/friendica/friendica/issues/12486#issuecomment-1492984392 --- diff --git a/src/Model/Item.php b/src/Model/Item.php index 5ba8ae1bf2..aa33418599 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -31,6 +31,7 @@ use Friendica\Core\System; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; +use Friendica\Network\HTTPException\InternalServerErrorException; use Friendica\Protocol\Activity; use Friendica\Protocol\ActivityPub; use Friendica\Protocol\Delivery; @@ -1394,10 +1395,16 @@ class Item * * @param integer $uri_id * @return void + * @throws InternalServerErrorException + * @throws \ImagickException */ public static function updateDisplayCache(int $uri_id) { $item = Post::selectFirst(self::DISPLAY_FIELDLIST, ['uri-id' => $uri_id]); + if (!$item) { + return; + } + self::prepareBody($item, false, false, true); }