b/2320107 NPE when receiving a Undock event without a device

Change-Id: Ic3c964f2d58462a1b7c82f2de2dd997679f90ba7
This commit is contained in:
Michael Chan
2009-12-10 22:53:14 -08:00
parent a87f2fd7d8
commit 9463c2f8d5

View File

@@ -131,7 +131,7 @@ public class BluetoothEventRedirector {
int anythingButUnDocked = Intent.EXTRA_DOCK_STATE_UNDOCKED + 1;
int state = intent.getIntExtra(Intent.EXTRA_DOCK_STATE, anythingButUnDocked);
if (state == Intent.EXTRA_DOCK_STATE_UNDOCKED) {
if (device.getBondState() == BluetoothDevice.BOND_NONE) {
if (device != null && device.getBondState() == BluetoothDevice.BOND_NONE) {
mManager.getCachedDeviceManager().onDeviceDisappeared(device);
}
}