diff --git a/src/BusProNet/Model/Booking.php b/src/BusProNet/Model/Booking.php index 3f908e0..a9ea3dd 100644 --- a/src/BusProNet/Model/Booking.php +++ b/src/BusProNet/Model/Booking.php @@ -249,7 +249,7 @@ class Booking foreach ([...$this->transportationServices, ...$this->additionalServices] as $service) { if ((in_array($participantIndex, $service->mapping) || true === $service->mandatory) && isset($service->individualPrice[$participantIndex])) { - $price += $service->individualPrice[$participantIndex]; + $price += $service->individualPrice[$participantIndex] ?? 0; } } @@ -257,13 +257,13 @@ class Booking foreach ($this->surcharges as $surcharge) { if (in_array($participantIndex, $surcharge->mapping) && isset($surcharge->individualPrice[$participantIndex])) { - $price += $surcharge->individualPrice[$participantIndex]; + $price += $surcharge->individualPrice[$participantIndex] ?? 0; } } $room = $this->getRoomForParticipant($participantIndex); if (null !== $room && isset($room->individualPrice[$participantIndex])) { - $price += $room->individualPrice[$participantIndex]; + $price += $room->individualPrice[$participantIndex] ?? 0; } return $price;