OSDN Git Service

Add a missing null-pointer check in HeadsetService.stop()
authorPavlin Radoslavov <pavlin@google.com>
Fri, 15 Apr 2016 00:49:45 +0000 (17:49 -0700)
committerPavlin Radoslavov <pavlin@google.com>
Fri, 15 Apr 2016 00:49:45 +0000 (17:49 -0700)
Bug: 27678483

Change-Id: I288b905d6b3f827a94365d512305cd29e186f3d4

src/com/android/bluetooth/hfp/HeadsetService.java

index cda51fc..10bf23a 100755 (executable)
@@ -78,7 +78,9 @@ public class HeadsetService extends ProfileService {
         } catch (Exception e) {
             Log.w(TAG,"Unable to unregister headset receiver",e);
         }
-        mStateMachine.doQuit();
+        if (mStateMachine != null) {
+            mStateMachine.doQuit();
+        }
         return true;
     }