diff --git a/util/ui.ts b/util/ui.ts index 3d1331e..a9d5e33 100644 --- a/util/ui.ts +++ b/util/ui.ts @@ -129,8 +129,7 @@ const getDateAndTimeFromCDPFileName = ( date: string ): FileNameParserResponse => { const datePortion = date.split('-') - if (!datePortion || datePortion.find((dp) => Number.isNaN(parseInt(dp)))) - return null + if (datePortion?.find((dp) => Number.isNaN(parseInt(dp)))) return null // The last number after the last dash is the hour const timePortion = datePortion.pop()