Fix undefined property accesses
Adds a check for root.currentDevice before accessing its properties
This commit is contained in:
parent
1bebc3bc5d
commit
f42bb35346
1 changed files with 3 additions and 3 deletions
|
@ -21,12 +21,12 @@ Kirigami.ScrollablePage {
|
||||||
icon.name: "network-disconnect"
|
icon.name: "network-disconnect"
|
||||||
onTriggered: root.currentDevice.unpair()
|
onTriggered: root.currentDevice.unpair()
|
||||||
text: i18nd("kdeconnect-app", "Unpair")
|
text: i18nd("kdeconnect-app", "Unpair")
|
||||||
visible: root.currentDevice.isPaired
|
visible: root.currentDevice && root.currentDevice.isPaired
|
||||||
},
|
},
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
icon.name: "hands-free"
|
icon.name: "hands-free"
|
||||||
text: i18nd("kdeconnect-app", "Send Ping")
|
text: i18nd("kdeconnect-app", "Send Ping")
|
||||||
visible: root.currentDevice.isPaired && root.currentDevice.isReachable
|
visible: root.currentDevice && root.currentDevice.isPaired && root.currentDevice.isReachable
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.currentDevice.pluginCall("ping", "sendPing");
|
root.currentDevice.pluginCall("ping", "sendPing");
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ Kirigami.ScrollablePage {
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
icon.name: "settings-configure"
|
icon.name: "settings-configure"
|
||||||
text: i18n("Plugin Settings")
|
text: i18n("Plugin Settings")
|
||||||
visible: root.currentDevice.isPaired && root.currentDevice.isReachable
|
visible: root.currentDevice && root.currentDevice.isPaired && root.currentDevice.isReachable
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
pageStack.push(
|
pageStack.push(
|
||||||
Qt.resolvedUrl("PluginSettings.qml"),
|
Qt.resolvedUrl("PluginSettings.qml"),
|
||||||
|
|
Loading…
Reference in a new issue