Merge PR #446: Fix app freeze when selecting a point in an empty graph

This commit is contained in:
Jenkins nymea 2020-09-28 20:38:50 +02:00
commit 25399c40f7
2 changed files with 9 additions and 2 deletions

View File

@ -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)

View File

@ -54,7 +54,11 @@ MainPageTile {
var page;
// Only one item? Go streight to the thing page
if (devicesProxy.count === 1) {
page = NymeaUtils.interfaceListToDevicePage([iface.name]);
if (!iface) {
page = "GenericDevicePage.qml";
} else {
page = NymeaUtils.interfaceListToDevicePage([iface.name]);
}
pageStack.push(Qt.resolvedUrl("../devicepages/" + page), {thing: devicesProxy.get(0)})
return;
}