From 080f511cce63118f9f4e7ebd7880de07ae9cd21e Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Fri, 17 Apr 2020 22:03:37 +0200 Subject: [PATCH] Fix NPE --- .../Plugins/FindMyPhonePlugin/FindMyPhonePlugin.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhonePlugin.java b/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhonePlugin.java index 32064f2b..ba3fff95 100644 --- a/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhonePlugin.java +++ b/src/org/kde/kdeconnect/Plugins/FindMyPhonePlugin/FindMyPhonePlugin.java @@ -188,6 +188,11 @@ public class FindMyPhonePlugin extends Plugin { } void stopPlaying() { + if (audioManager == null) { + // The Plugin was destroyed (probably the device disconnected) + return; + } + if (previousVolume != -1) { audioManager.setStreamVolume(AudioManager.STREAM_ALARM, previousVolume, 0); }