From 72a19d7eac3772ac1cfad8dc2db799e7d5acb577 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 27 Dec 2021 17:32:20 +0000 Subject: [PATCH] [COMPONENT][Posting] Fix error around mentions of actors that don't exist --- components/Posting/Posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Posting/Posting.php b/components/Posting/Posting.php index bb6fa0d540..69aa63bc68 100644 --- a/components/Posting/Posting.php +++ b/components/Posting/Posting.php @@ -267,7 +267,7 @@ class Posting extends Component } $mentioned = []; - foreach (F\unique(F\flat_map($mentions, fn (array $m) => $m['mentioned'] ?? []), fn (Actor $a) => $a->getId()) as $m) { + foreach (F\unique(F\flat_map($mentions, fn (array $m) => $m['mentioned'] ?? []), fn (Actor|null $a) => $a?->getId()) as $m) { if (!\is_null($m)) { $mentioned[] = $m->getId();