Skip to content

Commit

Permalink
Fix PostHog identify if user is not logged in (#2306)
Browse files Browse the repository at this point in the history
  • Loading branch information
pt2302 authored Sep 12, 2024
1 parent 20295cb commit 10778a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion static/js/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ if (SETTINGS.posthog_api_host && SETTINGS.posthog_project_api_key) {
},
})
// @ts-expect-error: SETTINGS.user is intentionally untyped
posthog.identify(SETTINGS.user.email)
if (SETTINGS.user) {
// @ts-expect-error: SETTINGS.user is intentionally untyped
posthog.identify(SETTINGS.user.email)
}
}

export const isErrorStatusCode = (statusCode: number): boolean =>
Expand Down

0 comments on commit 10778a7

Please sign in to comment.