Fix warning

This commit is contained in:
Michael 2023-03-06 06:43:04 +00:00
parent 699be97ea1
commit c1686c486c

View file

@ -40,7 +40,7 @@ class Card extends BaseFactory
public function createFromUriId(int $uriId, array $history = []): \Friendica\Object\Api\Mastodon\Card
{
$media = Post\Media::getByURIId($uriId, [Post\Media::HTML]);
if (empty($media) && empty($media[0]['description']) && !empty($media[0]['image']) && !empty($media[0]['preview'])) {
if (empty($media) || (empty($media[0]['description']) && empty($media[0]['image']) && empty($media[0]['preview']))) {
return new \Friendica\Object\Api\Mastodon\Card([], $history);
}