diff --git a/src/Entity/Note.php b/src/Entity/Note.php index 9527f60c90..a47f2fe68b 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -430,11 +430,14 @@ class Note extends Entity { $target_ids = $this->object_mentions_ids ?? []; if ($target_ids === []) { + $content = $this->getContent(); if (!\array_key_exists('object', $ids_already_known)) { - $mentions = Formatting::findMentions($this->getContent(), $this->getActor()); - foreach ($mentions as $mention) { - foreach ($mention['mentioned'] as $m) { - $target_ids[] = $m->getId(); + if (!\is_null($content)) { + $mentions = Formatting::findMentions($content, $this->getActor()); + foreach ($mentions as $mention) { + foreach ($mention['mentioned'] as $m) { + $target_ids[] = $m->getId(); + } } } } else {