fix: prevent null pointer exception

This commit is contained in:
Björn Fromme
2024-01-25 12:30:46 +01:00
parent ce7345176a
commit 8fafe3f546
+5 -1
View File
@@ -50,8 +50,12 @@ class AppRuntime implements RuntimeExtensionInterface
return 'nationality' === $property ? $country->getNationality() : $country->getName(); return 'nationality' === $property ? $country->getNationality() : $country->getName();
} }
public function bpnPickupLabel(int $id): string public function bpnPickupLabel(?int $id): string
{ {
if (null === $id) {
return 'keine Busbegleitung';
}
$pickup = $this->pickups->get($id); $pickup = $this->pickups->get($id);
if (null === $pickup) { if (null === $pickup) {