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 : [];