An empty array is truthy, [0] potentially isn't (#7961)
parent
a2457ab619
commit
be6cf4705c
|
@ -494,7 +494,7 @@ async function handler(req: CustomRequest) {
|
||||||
bookingToDelete.user.credentials
|
bookingToDelete.user.credentials
|
||||||
.filter((credential) => credential.type.endsWith("_video"))
|
.filter((credential) => credential.type.endsWith("_video"))
|
||||||
.forEach((credential) => {
|
.forEach((credential) => {
|
||||||
const uidToDelete = bookingToDelete?.references?.[0].uid ?? bookingToDelete.uid;
|
const uidToDelete = bookingToDelete?.references?.[0]?.uid ?? bookingToDelete.uid;
|
||||||
apiDeletes.push(deleteMeeting(credential, uidToDelete));
|
apiDeletes.push(deleteMeeting(credential, uidToDelete));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue