From 3e2c0776749f5d86df28ede659f30fb2f88aeb7b Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Thu, 23 Jan 2025 11:58:08 +0100 Subject: [PATCH] Fix NPE crash --- .../kdeconnect/Plugins/PresenterPlugin/PresenterActivity.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/kde/kdeconnect/Plugins/PresenterPlugin/PresenterActivity.kt b/src/org/kde/kdeconnect/Plugins/PresenterPlugin/PresenterActivity.kt index 66166229..a6ad292a 100644 --- a/src/org/kde/kdeconnect/Plugins/PresenterPlugin/PresenterActivity.kt +++ b/src/org/kde/kdeconnect/Plugins/PresenterPlugin/PresenterActivity.kt @@ -70,7 +70,11 @@ class PresenterActivity : AppCompatActivity(), SensorEventListener { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - plugin = KdeConnect.getInstance().getDevicePlugin(intent.getStringExtra("deviceId"), PresenterPlugin::class.java)!! + plugin = KdeConnect.getInstance().getDevicePlugin(intent.getStringExtra("deviceId"), PresenterPlugin::class.java) + ?: run { + finish() + return + } setContent { PresenterScreen() } createMediaSession() }