From 617b75198109f2ddf2af31bbb5a5db691a351186 Mon Sep 17 00:00:00 2001 From: Lianchao Song Date: Mon, 9 May 2016 22:50:57 +0800 Subject: [PATCH] Add missing null pointer check inside HeadSetClientService.stop() Bug: 28664857 Change-Id: I62abc4eb4127db2d4f0cde44eca618996f099b49 Signed-off-by: Lianchao Song cherry-picked from AOSP bebc4dd9edb40710d9588b4a2010eef227756a8e --- src/com/android/bluetooth/hfpclient/HeadsetClientService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/bluetooth/hfpclient/HeadsetClientService.java b/src/com/android/bluetooth/hfpclient/HeadsetClientService.java index 8945490a..0ea73fa0 100644 --- a/src/com/android/bluetooth/hfpclient/HeadsetClientService.java +++ b/src/com/android/bluetooth/hfpclient/HeadsetClientService.java @@ -90,7 +90,9 @@ public class HeadsetClientService extends ProfileService { } catch (Exception e) { Log.w(TAG, "Unable to unregister broadcast receiver", e); } - mStateMachine.doQuit(); + if (mStateMachine != null) { + mStateMachine.doQuit(); + } // Stop the HfpClientConnectionService. Intent stopIntent = new Intent(this, HfpClientConnectionService.class); -- 2.11.0