Skip to content

Commit

Permalink
Fixed null pointer (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
cren90 authored Apr 21, 2023
1 parent 97b4ead commit ace23de
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class BluetoothPeripheralManager(private val context: Context, private val bluet
}

private fun handleDeviceConnected(device: BluetoothDevice) {
Logger.i(TAG, "Central '%s' (%s) connected", device.name, device.address)
Logger.i(TAG, "Central '%s' (%s) connected", device.name ?: "null", device.address)
val bluetoothCentral = BluetoothCentral(device.address, device.name ?: "null")
connectedCentralsMap[bluetoothCentral.address] = bluetoothCentral
mainHandler.post { callback.onCentralConnected(bluetoothCentral) }
Expand Down Expand Up @@ -648,4 +648,4 @@ class BluetoothPeripheralManager(private val context: Context, private val bluet
val filter = IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED)
context.registerReceiver(adapterStateReceiver, filter)
}
}
}

0 comments on commit ace23de

Please sign in to comment.