early return updateCalendarEvent

pull/7270/head
Joe Au-Yeung 2023-02-21 13:52:54 -05:00
parent 8f3f17b299
commit 5a9f20b71b
1 changed files with 2 additions and 2 deletions

View File

@ -437,14 +437,14 @@ export default class EventManager {
private async updateAllCalendarEvents(
event: CalendarEvent,
booking: PartialBooking
): Promise<Array<EventResult<NewCalendarEventType>>> {
): Promise<Array<EventResult<NewCalendarEventType>> | []> {
let calendarReference: PartialReference | undefined = undefined,
credential;
try {
// Bookings should only have one calendar reference
calendarReference = booking.references.filter((reference) => reference.type.includes("_calendar"))[0];
if (!calendarReference) {
throw new Error("bookingRef");
return [];
}
const { uid: bookingRefUid, externalCalendarId: bookingExternalCalendarId } = calendarReference;