From: Michael Date: Sun, 11 Dec 2022 16:48:36 +0000 (+0000) Subject: Handle some fatal errors X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5d3248d57b53efeb0ab862a6e0bb2615b3253819;p=friendica.git Handle some fatal errors --- diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index 94b42ce79c..18701bb661 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -199,8 +199,11 @@ class Status extends BaseFactory } } - $item['body'] = $this->contentItem->addSharedPost($item); - $item['raw-body'] = $this->contentItem->addSharedPost($item, $item['raw-body']); + $item['body'] = $this->contentItem->addSharedPost($item); + + if (!is_null($item['raw-body'])) { + $item['raw-body'] = $this->contentItem->addSharedPost($item, $item['raw-body']); + } if ($is_reshare) { $reshare = $this->createFromUriId($uriId, $uid, false)->toArray(); diff --git a/src/Util/Images.php b/src/Util/Images.php index 533feec844..a6a9f4f7db 100644 --- a/src/Util/Images.php +++ b/src/Util/Images.php @@ -247,8 +247,11 @@ class Images if ($data) { $image = new Image($img_str); - $data['blurhash'] = $image->getBlurHash(); - $data['size'] = $filesize; + if ($image->isValid()) { + $data['blurhash'] = $image->getBlurHash(); + } + + $data['size'] = $filesize; } return is_array($data) ? $data : [];