summaryrefslogtreecommitdiffstats
path: root/packages/SettingsLib/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SettingsLib/src')
-rwxr-xr-xpackages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
index d3e7104..9a2f71c 100755
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
@@ -348,8 +348,12 @@ public final class BluetoothEventManager {
Log.e(TAG, "ACTION_PAIRING_CANCEL with no EXTRA_DEVICE");
return;
}
- int errorMsg = R.string.bluetooth_pairing_error_message;
CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device);
+ if (cachedDevice == null) {
+ Log.e(TAG, "ACTION_PAIRING_CANCEL with no cached device");
+ return;
+ }
+ int errorMsg = R.string.bluetooth_pairing_error_message;
Utils.showError(context, cachedDevice.getName(), errorMsg);
}
}