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(experiments): guard empty-state selector against undefined results (#65701)

Juraj Majerik4d7d16982d42
diff --git a/frontend/src/scenes/experiments/experimentsLogic.ts b/frontend/src/scenes/experiments/experimentsLogic.ts
index 15a42e0caa7f..c254663136a9 100644
--- a/frontend/src/scenes/experiments/experimentsLogic.ts
+++ b/frontend/src/scenes/experiments/experimentsLogic.ts
@@ -470,7 +470,11 @@ export const experimentsLogic = kea<experimentsLogicType>([
shouldShowEmptyState: [
(s) => [s.experimentsLoading, s.experiments, s.filters],
(experimentsLoading, experiments, filters): boolean => {
- return !experimentsLoading && experiments.results.length === 0 && objectsEqual(filters, DEFAULT_FILTERS)
+ return (
+ !experimentsLoading &&
+ (experiments.results?.length ?? 0) === 0 &&
+ objectsEqual(filters, DEFAULT_FILTERS)
+ )
},
],
pagination: [