fix: Improve safety of PostHog event handling by using optional chaining for properties

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-03-11 02:49:00 -07:00
parent 5e28125090
commit 7c3aedf811

View file

@ -10,8 +10,8 @@ function initPostHog() {
defaults: "2025-11-30",
capture_pageview: "history_change",
capture_pageleave: true,
before_send: (event) => {
if (event.properties) {
before_send: (event) => {
if (event?.properties) {
const params = new URLSearchParams(window.location.search);
const ref = params.get("ref");
if (ref) {