Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(persons): guard non-string url search before trimming (#63401)

Paul D'Ambradc77eb69c0d6
diff --git a/frontend/src/scenes/persons/PersonsScene.tsx b/frontend/src/scenes/persons/PersonsScene.tsx
index d0d976d3d212..cff94f5e4017 100644
--- a/frontend/src/scenes/persons/PersonsScene.tsx
+++ b/frontend/src/scenes/persons/PersonsScene.tsx
@@ -47,7 +47,8 @@ export function PersonsScene(): JSX.Element {
// A UUID-shaped search that returns nothing is often a session ID typed into the wrong field.
// Session IDs aren't part of the persons query, so point the user to where they are searchable.
- const searchTerm = (query.source as ActorsQuery | undefined)?.search?.trim()
+ const rawSearch: unknown = (query.source as Partial<ActorsQuery> | undefined)?.search
+ const searchTerm = typeof rawSearch === 'string' ? rawSearch.trim() : undefined
const searchLooksLikeSessionId = !!searchTerm && isUUIDLike(searchTerm)
useOnMountEffect(() => {