From 2d876152aa60e4ea9e3d58c59a93db3bd29b2879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 8 Oct 2026 11:10:13 +0200 Subject: [PATCH] fix: drop unreachable null check --- src/Service/ParticipantCardAssembler.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Service/ParticipantCardAssembler.php b/src/Service/ParticipantCardAssembler.php index d85c22e0..af6d49b1 100644 --- a/src/Service/ParticipantCardAssembler.php +++ b/src/Service/ParticipantCardAssembler.php @@ -142,16 +142,12 @@ class ParticipantCardAssembler int $index, ?array $precomputedPrices = null, ): ParticipantCardPriceDto { - // Check if canceled (only possible in edit mode when booking property is set) - $isCanceled = ($bookingDto->booking?->participantsStatus[$index] ?? null) === 'S'; + // Canceled participants only exist in edit mode, where the booking is set + $booking = $bookingDto->booking; - if (true === $isCanceled) { + if (null !== $booking && 'S' === ($booking->participantsStatus[$index] ?? null)) { // Calculate surcharge total for canceled participant - if (null === $bookingDto->booking) { - return new ParticipantCardPriceDto(null, true); - } - - $surcharges = $bookingDto->booking->getSurchargesForParticipant($index); + $surcharges = $booking->getSurchargesForParticipant($index); $surchargeTotal = 0.0; foreach ($surcharges as $surcharge) {