OSDN Git Service

Fix NPE crash while removeBatch
authorjun.x.wang <jun.x.wang@sonymobile.com>
Thu, 14 Aug 2014 05:36:59 +0000 (13:36 +0800)
committerAndre Eisenbach <eisenbach@google.com>
Thu, 18 Feb 2016 18:55:57 +0000 (10:55 -0800)
When unpairing two devices, the BluetoothOppShareInfo
in BluetoothOppBatch may be null during transfer.

Change-Id: I7b4fbd0f291250deebdeaea4bf2d2f540fe233dc

src/com/android/bluetooth/opp/BluetoothOppService.java

index f952bec..edec7c8 100755 (executable)
@@ -868,7 +868,8 @@ public class BluetoothOppService extends Service {
                         mServerTransfer = new BluetoothOppTransfer(this, mPowerManager, nextBatch,
                                                                    mServerSession);
                         mServerTransfer.start();
-                        if (nextBatch.getPendingShare().mConfirm ==
+                        if (nextBatch.getPendingShare() != null
+                            && nextBatch.getPendingShare().mConfirm ==
                                 BluetoothShare.USER_CONFIRMATION_CONFIRMED) {
                             mServerTransfer.confirmStatusChanged();
                         }