Skip to content

Commit 65e831e

Browse files
committed
Well, you can have 0 attendees in a booking
1 parent 295748a commit 65e831e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

apps/web/lib/getBooking.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ function getResponsesFromOldBooking(
3030
return acc;
3131
}, {});
3232
return {
33-
name: rawBooking.attendees[0].name,
34-
email: rawBooking.attendees[0].email,
33+
// It is possible to have no attendees in a booking when the booking is cancelled.
34+
name: rawBooking.attendees[0]?.name || "Nameless",
35+
email: rawBooking.attendees[0]?.email || "",
3536
guests: rawBooking.attendees.slice(1).map((attendee) => {
3637
return attendee.email;
3738
}),

0 commit comments

Comments
 (0)