mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 01:51:47 +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 device = BackgroundService.getInstance().getDevice(controlIdParts[0])
|
||||
|
||||
if (!device.isPaired) return null
|
||||
if (device == null || !device.isPaired) return null
|
||||
|
||||
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)
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user