Skip to content

Commit

Permalink
return early for undefined surveys
Browse files Browse the repository at this point in the history
  • Loading branch information
liyiy committed Sep 26, 2023
1 parent a75b564 commit e9955bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/posthog-surveys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export class PostHogSurveys {

getActiveMatchingSurveys(callback: SurveyCallback, forceReload = false) {
this.getSurveys((surveys) => {
if (!surveys) {
return callback([])
}
const activeSurveys = surveys.filter((survey) => {
return !!(survey.start_date && !survey.end_date)
})
Expand Down

0 comments on commit e9955bb

Please sign in to comment.