Skip to content

Commit

Permalink
fix(experiments): Prevent crash when sharedMetrics isn't loaded (#28663)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
danielbachhuber and github-actions[bot] authored Feb 13, 2025
1 parent 61d00f0 commit 7a01626
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/src/scenes/experiments/experimentLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,9 @@ export const experimentLogic = kea<experimentLogicType>([
compatibleSharedMetrics: [
(s) => [s.sharedMetrics, s.shouldUseExperimentMetrics],
(sharedMetrics: SharedMetric[], shouldUseExperimentMetrics: boolean): SharedMetric[] => {
if (!sharedMetrics) {
return []
}
if (shouldUseExperimentMetrics) {
return sharedMetrics.filter((metric) => metric.query.kind === NodeKind.ExperimentMetric)
}
Expand Down

0 comments on commit 7a01626

Please sign in to comment.