mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-23 00:33:09 +02:00
check if device is not null
This commit is contained in:
@@ -84,6 +84,10 @@ public class BluetoothPreferences extends PreferenceFragment implements SharedPr
|
|||||||
//bluetooth device found
|
//bluetooth device found
|
||||||
BluetoothDevice device = (BluetoothDevice) intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
BluetoothDevice device = (BluetoothDevice) intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||||
|
|
||||||
|
if (device.getName() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foundDevices.put(device.getAddress(), device.getName());
|
foundDevices.put(device.getAddress(), device.getName());
|
||||||
|
|
||||||
for (Map.Entry<String, String> entry : foundDevices.entrySet()) {
|
for (Map.Entry<String, String> entry : foundDevices.entrySet()) {
|
||||||
|
Reference in New Issue
Block a user