Skip to content

Commit

Permalink
Merge pull request #1541 from Spiteless/ts.1540
Browse files Browse the repository at this point in the history
fix: Handle event.date being undefined in closeCheckins
  • Loading branch information
trillium authored Nov 11, 2023
2 parents d6d81a1 + 8a56f1c commit 23e6122
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/workers/closeCheckins.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ module.exports = (cron, fetch) => {
if (events && events.length > 0) {

const sortedEvents = events.filter(event => {
if (!event.date) {
// handle if event date is null/undefined
// false meaning don't include in sortedEvents
return false
}

const currentTimeISO = new Date().toISOString();
const threeHoursFromStartTime = new Date(event.date).getTime() + 10800000;
const threeHoursISO = new Date(threeHoursFromStartTime).toISOString();
Expand Down

0 comments on commit 23e6122

Please sign in to comment.