Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Fix error on cycling through intervals with hotkey (#6342)

Artur Pata9366b3f90a1a
diff --git a/assets/js/dashboard/components/graph.tsx b/assets/js/dashboard/components/graph.tsx
index 3ce601d0f5..8a2d1ed003 100644
--- a/assets/js/dashboard/components/graph.tsx
+++ b/assets/js/dashboard/components/graph.tsx
@@ -482,7 +482,8 @@ function InnerGraph<T extends GraphYValues>({
let line = svg.select<SVGLineElement>(
`#${highlightIndicatorGroupId} line`
)
- const shouldShowLine = typeof highlightedIndex === 'number'
+ const shouldShowLine =
+ typeof highlightedIndex === 'number' && points[highlightedIndex]
if (shouldShowLine) {
const { x } = points[highlightedIndex]
if (line.empty()) {