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

pull/7964/head
Alex van Andel 2023-03-28 00:16:52 +02:00 committed by GitHub
parent a2457ab619
commit be6cf4705c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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));
});
}