Handle some fatal errors

This commit is contained in:
Michael 2022-12-11 16:48:36 +00:00
parent 35ce394948
commit 5d3248d57b
2 changed files with 10 additions and 4 deletions

View file

@ -199,8 +199,11 @@ class Status extends BaseFactory
} }
} }
$item['body'] = $this->contentItem->addSharedPost($item); $item['body'] = $this->contentItem->addSharedPost($item);
$item['raw-body'] = $this->contentItem->addSharedPost($item, $item['raw-body']);
if (!is_null($item['raw-body'])) {
$item['raw-body'] = $this->contentItem->addSharedPost($item, $item['raw-body']);
}
if ($is_reshare) { if ($is_reshare) {
$reshare = $this->createFromUriId($uriId, $uid, false)->toArray(); $reshare = $this->createFromUriId($uriId, $uid, false)->toArray();

View file

@ -247,8 +247,11 @@ class Images
if ($data) { if ($data) {
$image = new Image($img_str); $image = new Image($img_str);
$data['blurhash'] = $image->getBlurHash(); if ($image->isValid()) {
$data['size'] = $filesize; $data['blurhash'] = $image->getBlurHash();
}
$data['size'] = $filesize;
} }
return is_array($data) ? $data : []; return is_array($data) ? $data : [];