filter out null bluetooth names

pull/547/head
andrekir 2022-12-23 22:23:48 -03:00
rodzic ed4862a135
commit 4632b8f956
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -328,7 +328,7 @@ class BTScanModel @Inject constructor(
@SuppressLint("MissingPermission")
private fun addBluetoothDevices() {
bluetoothRepository.getBondedDevices()
?.filter { it.name.matches(Regex(BLE_NAME_PATTERN)) }
?.filter { it.name != null && it.name.matches(Regex(BLE_NAME_PATTERN)) }
?.forEach {
addDevice(DeviceListEntry(it.name, "x${it.address}", true))
}