From a6339312e417d399945a330c6510b32e055d8568 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Sat, 26 Jun 2021 12:44:52 +0300 Subject: [PATCH] Fix crash --- .../RunCommandPlugin/RunCommandControlsProviderService.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/kde/kdeconnect/Plugins/RunCommandPlugin/RunCommandControlsProviderService.kt b/src/org/kde/kdeconnect/Plugins/RunCommandPlugin/RunCommandControlsProviderService.kt index af31b175..c2ce88e9 100644 --- a/src/org/kde/kdeconnect/Plugins/RunCommandPlugin/RunCommandControlsProviderService.kt +++ b/src/org/kde/kdeconnect/Plugins/RunCommandPlugin/RunCommandControlsProviderService.kt @@ -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 {