Skip to content

Commit

Permalink
Fix: fully stop processing scheduled event if its not in the DB anymo…
Browse files Browse the repository at this point in the history
…re (#14)
  • Loading branch information
cbackas authored Aug 4, 2023
1 parent 0f35d1b commit 2da49d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/episodeNotifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ async function scheduleNotification (discord: Client, settingsManager: SettingsM
}
})

if (show == null) {
console.error(`Scheduled notification aborted: show not found (${payload.showName})[${payload.imdbId}]`)
return
}

const showDestinations = show?.destinations ?? []

// send the message to all the channels subscribed to the show
Expand Down

0 comments on commit 2da49d5

Please sign in to comment.