diff options
author | Roman Birg <roman@cyngn.com> | 2016-03-29 13:51:56 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-03-29 13:53:14 -0700 |
commit | 207ef55cb7d28701f0bfd1bc012061f28e584ca1 (patch) | |
tree | 0b69e1a81561437f657466973188ce187373d86d | |
parent | 0256ad879553cd37bcf06be7fb29029124cde89f (diff) | |
download | android_packages_apps_Bluetooth-staging/cm-13.0-caf.tar.gz android_packages_apps_Bluetooth-staging/cm-13.0-caf.tar.bz2 android_packages_apps_Bluetooth-staging/cm-13.0-caf.zip |
Bluetooth: fix potential NPEstaging/cm-13.0-caf
Change-Id: I807f38df94a1e7ccf0622f8d8ec86a9518de9dc6
Signed-off-by: Roman Birg <roman@cyngn.com>
-rw-r--r-- | src/com/android/bluetooth/opp/BluetoothOppService.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java index 10437fb30..1dc1d7ac8 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppService.java +++ b/src/com/android/bluetooth/opp/BluetoothOppService.java @@ -399,10 +399,14 @@ public class BluetoothOppService extends Service { mOppManager.isOPPServiceUp = false; getContentResolver().unregisterContentObserver(mObserver); unregisterReceiver(mBluetoothReceiver); - mSocketListener.stop(); - mL2cSocketListener.stop(); - mSocketListener = null; - mL2cSocketListener = null; + if (mSocketListener != null) { + mSocketListener.stop(); + mSocketListener = null; + } + if (mL2cSocketListener != null) { + mL2cSocketListener.stop(); + mL2cSocketListener = null; + } if(mBatchs != null) { mBatchs.clear(); |