diff options
author | Arseniy Movshev <dodoradio@outlook.com> | 2023-06-30 10:13:13 +0100 |
---|---|---|
committer | Arseniy Movshev <dodoradio@outlook.com> | 2023-06-30 10:14:09 +0100 |
commit | 73a26015844091c43425e6a549ed05ec0e61c197 (patch) | |
tree | 2b9aae82ff7551a82dee55d006c11fb9f04982be | |
parent | ea4354b3e1c01549e9c27e6b0918cc7efca3af91 (diff) |
Check for data size before trying to load heartrate data
Diffstat (limited to '')
-rw-r--r-- | src/cpp/hrGraph.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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<QVariant> 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(); |