Skip to content

Scheduling infrastructure for absolutely everyone.

An empty array is truthy, [0] potentially isn't (#7961)

Alex van Andelbe6cf4705c55
diff --git a/packages/features/bookings/lib/handleCancelBooking.ts b/packages/features/bookings/lib/handleCancelBooking.ts
index acbb03c994f..cea53d5ed1f 100644
--- a/packages/features/bookings/lib/handleCancelBooking.ts
+++ b/packages/features/bookings/lib/handleCancelBooking.ts
@@ -494,7 +494,7 @@ async function handler(req: CustomRequest) {
bookingToDelete.user.credentials
.filter((credential) => credential.type.endsWith("_video"))
.forEach((credential) => {
- const uidToDelete = bookingToDelete?.references?.[0].uid ?? bookingToDelete.uid;
+ const uidToDelete = bookingToDelete?.references?.[0]?.uid ?? bookingToDelete.uid;
apiDeletes.push(deleteMeeting(credential, uidToDelete));
});
}