[COMPONENT][Posting] Fix error around mentions of actors that don't exist

This commit is contained in:
Hugo Sales 2021-12-27 17:32:20 +00:00
parent b84315c95b
commit 72a19d7eac
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -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();