From 79aca207c4e699d93309b4ca4a58a599285bf48f Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sat, 18 Feb 2023 21:31:59 +0100 Subject: [PATCH] Avoid qml errors on shutdown --- DeviceTypesSettingsPage.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DeviceTypesSettingsPage.qml b/DeviceTypesSettingsPage.qml index 280aa54..3e262c5 100644 --- a/DeviceTypesSettingsPage.qml +++ b/DeviceTypesSettingsPage.qml @@ -69,13 +69,13 @@ ColumnLayout { SpinBox { enabled: false Layout.fillWidth: true - value: listView.currentData.id + value: listView.currentData ? listView.currentData.id : -1 onValueModified: listView.currentData.id = value } Label { text: qsTr("Name:") } TextField { Layout.fillWidth: true - text: listView.currentData.name + text: listView.currentData ? listView.currentData.name : '' onTextEdited: listView.currentData.name = text } Label { text: qsTr("Icon:") } @@ -103,7 +103,7 @@ ColumnLayout { Layout.fillWidth: true Layout.fillHeight: true - deviceTypeId: listView.currentData.id + deviceTypeId: listView.currentData ? listView.currentData.id : -1 } } Item {