mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 09:58:08 +00:00
Fix crash
This commit is contained in:
parent
d43c9aa325
commit
a6339312e4
@ -167,10 +167,10 @@ class RunCommandControlsProviderService : ControlsProviderService() {
|
|||||||
val controlIdParts = controlId.split("-")
|
val controlIdParts = controlId.split("-")
|
||||||
val device = BackgroundService.getInstance().getDevice(controlIdParts[0])
|
val device = BackgroundService.getInstance().getDevice(controlIdParts[0])
|
||||||
|
|
||||||
if (!device.isPaired) return null
|
if (device == null || !device.isPaired) return null
|
||||||
|
|
||||||
val commandList = if (device.isReachable) {
|
val commandList = if (device.isReachable) {
|
||||||
device?.getPlugin(RunCommandPlugin::class.java)?.commandList?.map { jsonObject ->
|
device.getPlugin(RunCommandPlugin::class.java)?.commandList?.map { jsonObject ->
|
||||||
CommandEntryWithDevice(jsonObject.getString("name"), jsonObject.getString("command"), jsonObject.getString("key"), device)
|
CommandEntryWithDevice(jsonObject.getString("name"), jsonObject.getString("command"), jsonObject.getString("key"), device)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user