From 124936b6cfc848483df69d0eacd0dcfd7fb34a12 Mon Sep 17 00:00:00 2001 From: Eric Severance Date: Sun, 12 Jan 2025 10:05:04 -0800 Subject: [PATCH] Avoid a potential NULL pointer reference in nrf52/BluetoothPhoneAPI (#5830) --- src/platform/nrf52/NRF52Bluetooth.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/platform/nrf52/NRF52Bluetooth.cpp b/src/platform/nrf52/NRF52Bluetooth.cpp index 31bbc7fa90..541e90ab2a 100644 --- a/src/platform/nrf52/NRF52Bluetooth.cpp +++ b/src/platform/nrf52/NRF52Bluetooth.cpp @@ -44,11 +44,7 @@ class BluetoothPhoneAPI : public PhoneAPI } /// Check the current underlying physical link to see if the client is currently connected - virtual bool checkIsConnected() override - { - BLEConnection *connection = Bluefruit.Connection(connectionHandle); - return connection->connected(); - } + virtual bool checkIsConnected() override { return Bluefruit.connected(connectionHandle); } }; static BluetoothPhoneAPI *bluetoothPhoneAPI;