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

This commit is contained in:
2022-01-04 18:56:21 +00:00
parent d17f276419
commit 0758d6145b

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);
}
}