[COMPONENT][Collection][CONTROLLER][Collection] Use null-safe calls to attempt to get a language

This commit is contained in:
Hugo Sales 2022-01-04 18:56:21 +00:00
parent d17f276419
commit 0758d6145b
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -14,7 +14,7 @@ class Collection extends Controller
public function query(string $query, ?string $locale = null, ?Actor $actor = null)
{
$actor ??= Common::actor();
$locale ??= Common::currentLanguage()->getLocale();
$locale ??= $actor?->getTopLanguage()?->getLocale();
return Feed::query($query, $this->int('page') ?? 1, $locale, $actor);
}
}