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(aio): guard null query response in clusters logic (#71240)

Radu Raicea82b813221912
diff --git a/products/ai_observability/frontend/clusters/clustersLogic.ts b/products/ai_observability/frontend/clusters/clustersLogic.ts
index 5599db318f54..6bc75f39c13a 100644
--- a/products/ai_observability/frontend/clusters/clustersLogic.ts
+++ b/products/ai_observability/frontend/clusters/clustersLogic.ts
@@ -303,7 +303,7 @@ export const clustersLogic = kea<clustersLogicType>([
breakpoint()
const matched = new Set<string>()
- for (const row of response.results || []) {
+ for (const row of response?.results || []) {
const id = (row as unknown[])[0]
if (typeof id === 'string' && id) {
matched.add(id)
@@ -344,7 +344,7 @@ export const clustersLogic = kea<clustersLogicType>([
}
)
- return (response.results || []).map((row: string[]) => ({
+ return (response?.results || []).map((row: string[]) => ({
runId: row[0],
windowEnd: row[1],
label: dayjs(row[2]).format('MMM D, YYYY h:mm A'),
@@ -385,7 +385,7 @@ export const clustersLogic = kea<clustersLogicType>([
{ queryParams: { modifiers: { convertToProjectTimezone: false } } }
)
- if (!response.results?.length) {
+ if (!response?.results?.length) {
return null
}