Skip to content

Scheduling infrastructure for absolutely everyone.

Well, you can have 0 attendees in a booking (#7494)

Hariom Balharad8387835a8a8
diff --git a/apps/web/lib/getBooking.tsx b/apps/web/lib/getBooking.tsx
index 953422f67e4..33771c7efae 100644
--- a/apps/web/lib/getBooking.tsx
+++ b/apps/web/lib/getBooking.tsx
@@ -30,8 +30,9 @@ function getResponsesFromOldBooking(
return acc;
}, {});
return {
- name: rawBooking.attendees[0].name,
- email: rawBooking.attendees[0].email,
+ // It is possible to have no attendees in a booking when the booking is cancelled.
+ name: rawBooking.attendees[0]?.name || "Nameless",
+ email: rawBooking.attendees[0]?.email || "",
guests: rawBooking.attendees.slice(1).map((attendee) => {
return attendee.email;
}),