Fix: Make country name filter failure tolerant

This commit is contained in:
Björn Fromme
2023-10-12 15:08:47 +02:00
parent 541283fc34
commit 4b7afb109d
2 changed files with 6 additions and 2 deletions
@@ -32,8 +32,12 @@ class CountryDataProvider
return $countries;
}
public function get(string $token): ?Country
public function get(?string $token): ?Country
{
if (null === $token) {
return null;
}
return $this->getAll()[$token] ?? null;
}
}
+1 -1
View File
@@ -36,7 +36,7 @@ class AppRuntime implements RuntimeExtensionInterface
return sprintf('Offizielle %slehrer*innenlizenz', ucfirst(strtolower($type)));
}
public function bpnCountryLabel(string $token, string $property = 'name'): string
public function bpnCountryLabel(?string $token, string $property = 'name'): string
{
$country = $this->countries->get($token);