From 73a26015844091c43425e6a549ed05ec0e61c197 Mon Sep 17 00:00:00 2001 From: Arseniy Movshev Date: Fri, 30 Jun 2023 10:13:13 +0100 Subject: Check for data size before trying to load heartrate data --- src/cpp/hrGraph.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cpp') diff --git a/src/cpp/hrGraph.cpp b/src/cpp/hrGraph.cpp index ea42b13..ccec424 100644 --- a/src/cpp/hrGraph.cpp +++ b/src/cpp/hrGraph.cpp @@ -77,6 +77,10 @@ void HrGraph::paint(QPainter *painter) void HrGraph::loadGraphData(QVariant fileDataInput) { qDebug() << "loadGraphData called"; QList fileDataAsList = fileDataInput.toList(); + if (fileDataAsList.count() < 1) { + qDebug() << "no heartrate data to show, failing load"; + return; + } int j = fileDataAsList.count(); minTime = fileDataAsList[0].toPoint().x(); maxTime = fileDataAsList[j-1].toPoint().x(); -- cgit v1.2.3-70-g09d2