From 4276336832b61a04876853145ee8a20e397a9007 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 28 Sep 2020 20:30:58 +0200 Subject: [PATCH] Fix app freeze when trying to select a point on an empty graph --- nymea-app/ui/customviews/GenericTypeGraph.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nymea-app/ui/customviews/GenericTypeGraph.qml b/nymea-app/ui/customviews/GenericTypeGraph.qml index fa5ae35a..0ffacb48 100644 --- a/nymea-app/ui/customviews/GenericTypeGraph.qml +++ b/nymea-app/ui/customviews/GenericTypeGraph.qml @@ -314,7 +314,10 @@ Item { } function markClosestPoint(point) { - var found = false; + if (lineSeries1.count == 0) { + return; + } + if (lineSeries1.count == 1) { selectedHighlights.removePoints(0, selectedHighlights.count) selectedHighlights.append(lineSeries1.at(0).x, lineSeries1.at(1).y)