diff --git a/src/Object/Api/Mastodon/Card.php b/src/Object/Api/Mastodon/Card.php index 990f6a6bf..46aea3c28 100644 --- a/src/Object/Api/Mastodon/Card.php +++ b/src/Object/Api/Mastodon/Card.php @@ -59,4 +59,18 @@ class Card extends BaseEntity $this->type = $attachment['type'] ?? ''; $this->image = $attachment['image'] ?? ''; } + + /** + * Returns the current entity as an array + * + * @return array + */ + public function toArray() + { + if (empty($this->url)) { + return null; + } + + return parent::toArray(); + } }