OSDN Git Service

Fixed a NPE
authorPriti Aghera <paghera@broadcom.com>
Mon, 15 Apr 2013 21:16:04 +0000 (14:16 -0700)
committerMatthew Xie <mattx@google.com>
Thu, 18 Apr 2013 19:07:30 +0000 (12:07 -0700)
Bluetooth share was crashing due to NPE. Included a check for
Inputstream in BluetoothOppSendFileInfo.

bug #7924487
Change-Id: Iccceb607a46962f84538e912d62f407ad5ee2f21

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

index a3befb9..24b7606 100644 (file)
@@ -322,7 +322,7 @@ public class BluetoothOppUtility {
     static void closeSendFileInfo(Uri uri) {
         if (D) Log.d(TAG, "closeSendFileInfo: uri=" + uri);
         BluetoothOppSendFileInfo info = sSendFileMap.remove(uri);
-        if (info != null) {
+        if (info != null && info.mInputStream != null) {
             try {
                 info.mInputStream.close();
             } catch (IOException ignored) {