Skip to content

Commit d59b363

Browse files
committed
fix undefiend posthog instacne
1 parent fa025bd commit d59b363

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

run/lib/analytics.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ class Analytics {
1010

1111
track(distinctId, event, properties) {
1212
if (!this.posthog || !distinctId || !event || !isMarketingEnabled) return;
13-
this.posthog.capture({ distinctId, event, properties });
13+
this.posthog && this.posthog.capture({ distinctId, event, properties });
1414
}
1515

1616
shutdown() {
1717
if (!isMarketingEnabled) return;
18-
this.posthog.shutdown();
18+
this.posthog && this.posthog.shutdown();
1919
}
2020
}
2121

0 commit comments

Comments
 (0)