diff --git a/scripts/google/client.ts b/scripts/google/client.ts index 3d2b475..c82b5f2 100644 --- a/scripts/google/client.ts +++ b/scripts/google/client.ts @@ -73,6 +73,13 @@ export const parseSheetToShowList = async ( return acc; } const shows = await acc; + if (index > 0 && !shows[index - 1]) { + throw new Error( + `Failed to parse showlist sheet. Invalid data before ${JSON.stringify( + sheetRow + )}` + ); + } const previousEndTime = index ? shows[index - 1].end : showStartTime; const startDate = new Date(previousEndTime);