Skip to content

Commit

Permalink
Device name can be null in some circumstances
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-matt-hillsdon committed Apr 23, 2024
1 parent 013c3e6 commit cd0e5ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/com/samsung/microbit/utils/BLEPair.java
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ public void onReceive(Context context, Intent intent) {
final int state = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR);
final int prevState = intent.getIntExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE, BluetoothDevice.ERROR);
logi("pairReceiver -" + " name = " + name + " addr = " + addr + " state = " + state + " prevState = " + prevState);
if (name.isEmpty() || addr.isEmpty()) {
if (name == null || name.isEmpty() || addr.isEmpty()) {
return;
}
// Check the changed device is the one we are trying to pair
Expand Down

0 comments on commit cd0e5ff

Please sign in to comment.