Skip to content

Commit

Permalink
fix(insights): fix histogram breakdown formatting (#22948)
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr authored Jun 13, 2024
1 parent 4e0c8f9 commit 7be03a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/scenes/insights/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ export function formatBreakdownLabel(
cohorts: CohortType[] | undefined,
formatPropertyValueForDisplay: FormatPropertyValueForDisplayFunction | undefined
): string {
if (breakdownFilter?.breakdown_histogram_bin_count != null && typeof breakdown_value === 'string') {
if (
breakdownFilter?.breakdown_histogram_bin_count != null &&
typeof breakdown_value === 'string' &&
breakdown_value.length > 0
) {
// replace nan with null
const bucketValues = breakdown_value.replace(/\bnan\b/g, 'null')
const [bucketStart, bucketEnd] = JSON.parse(bucketValues)
Expand Down

0 comments on commit 7be03a7

Please sign in to comment.