From 42ac2d4f1a540d6fa8592d92ab696d20beb1ee68 Mon Sep 17 00:00:00 2001 From: Ryan Cohen Date: Wed, 6 Dec 2023 05:47:34 -0500 Subject: [PATCH] Fix crash when hovering over the cache statistics chart (#324) Reported by @margheritarufi --- src/cachesim/chartlinemarker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cachesim/chartlinemarker.cpp b/src/cachesim/chartlinemarker.cpp index 16af4c29..99917cd7 100644 --- a/src/cachesim/chartlinemarker.cpp +++ b/src/cachesim/chartlinemarker.cpp @@ -58,6 +58,9 @@ void ChartLineMarker::move(const QPointF ¢er) { // Note: we assume that the points are in a sorted order! const auto &points = m_series->points(); + if (points.size() == 0) { + return; + } const QPointF chartPos = m_chart->mapToValue(center); auto iter = std::lower_bound(points.begin(), points.end(), chartPos.x(),