mirror of
https://github.com/meshtastic/firmware.git
synced 2026-10-05 04:35:48 -04:00
Fix null pointer dereference in updateBatteryLevel function (#10588)
This commit is contained in:
1 parent
64e35908c9
commit
3feb155a5f
1 file changed
+1
-1
@@ -862,7 +862,7 @@ void NimbleBluetooth::setupService()
|
||||
/// Given a level between 0-100, update the BLE attribute
|
||||
void updateBatteryLevel(uint8_t level)
|
||||
{
|
||||
if ((config.bluetooth.enabled == true) && nimbleBluetooth->isConnected()) {
|
||||
if ((config.bluetooth.enabled == true) && nimbleBluetooth && nimbleBluetooth->isConnected()) {
|
||||
BatteryCharacteristic->setValue(&level, 1);
|
||||
BatteryCharacteristic->notify();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user