Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9201620 authored by Srinu Jella's avatar Srinu Jella Committed by Gerrit - the friendly Code Review server
Browse files

Bluetooth: Add NULL check before accessing device data

Add NULL check for device variable before accessing
device bond state, so that NULL pointer exception can
be prevented.

CRs-Fixed: 609990
Change-Id: I339f4f59e54ee10ffffa5eff5f9c06811dbce865
parent 85e08c94
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ public class BluetoothController extends BroadcastReceiver {
            Set<BluetoothDevice> devices = adapter.getBondedDevices();
            if (devices != null) {
                for (BluetoothDevice device : devices) {
                    if (device.getBondState() != BluetoothDevice.BOND_NONE) {
                    if ((device != null) && (device.getBondState() != BluetoothDevice.BOND_NONE)) {
                        mBondedDevices.add(device);
                    }
                }