Skip to content

Commit 1392a47

Browse files
committed
An empty array is truthy, [0] potentially isn't
1 parent 867966d commit 1392a47

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/features/bookings/lib/handleCancelBooking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ async function handler(req: CustomRequest) {
494494
bookingToDelete.user.credentials
495495
.filter((credential) => credential.type.endsWith("_video"))
496496
.forEach((credential) => {
497-
const uidToDelete = bookingToDelete?.references?.[0].uid ?? bookingToDelete.uid;
497+
const uidToDelete = bookingToDelete?.references?.[0]?.uid ?? bookingToDelete.uid;
498498
apiDeletes.push(deleteMeeting(credential, uidToDelete));
499499
});
500500
}

0 commit comments

Comments
 (0)