From 09a46375568610fbe4dc7b2c6d86e049443c8320 Mon Sep 17 00:00:00 2001 From: Niclas Edenvin Date: Tue, 6 May 2025 14:17:39 +0200 Subject: [PATCH] Nullcheck of rooms --- apps/scandic-web/stores/enter-details/helpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/scandic-web/stores/enter-details/helpers.ts b/apps/scandic-web/stores/enter-details/helpers.ts index 525147b08..42fd0c769 100644 --- a/apps/scandic-web/stores/enter-details/helpers.ts +++ b/apps/scandic-web/stores/enter-details/helpers.ts @@ -33,12 +33,12 @@ export function checkIsSameBooking( ) { const { rooms: prevRooms, errorCode: prevErrorCode, ...prevBooking } = prev - const prevRoomsWithoutRateCodes = prevRooms.map( + const prevRoomsWithoutRateCodes = prevRooms?.map( ({ rateCode, counterRateCode, roomTypeCode, ...room }) => room ) const { rooms: nextRooms, errorCode: nextErrorCode, ...nextBooking } = next - const nextRoomsWithoutRateCodes = nextRooms.map( + const nextRoomsWithoutRateCodes = nextRooms?.map( ({ rateCode, counterRateCode, roomTypeCode, ...room }) => room )