Skip to content

Commit

Permalink
Add more defensiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Apr 3, 2024
1 parent a1619cc commit 4ce0916
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const defaultConfig = (): PostHogConfig => ({
save_referrer: true,
capture_pageview: true,
capture_pageleave: true, // We'll only capture pageleave events if capture_pageview is also true
debug: (location?.search && location.search.indexOf('__posthog_debug=true') !== -1) || false,
debug: (location && _isString(location?.search) && location.search.indexOf('__posthog_debug=true') !== -1) || false,
verbose: false,
cookie_expiration: 365,
upgrade: false,
Expand Down

0 comments on commit 4ce0916

Please sign in to comment.