Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9eea85f

Browse files
Check if m_pServerCallbacks is not null before calling method. (#5603)
Fixes: #5573 To reproduce: 1. Run any sample code that starts a BLE server, and does not call `setCallbacks`. 2. Connect to the device using the "LightBlue" app on iOS. 3. Observe crash shown in the issue linked above.
1 parent 24b76cb commit 9eea85f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎libraries/BLE/src/BLEServer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ void BLEServer::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_gatt_if_t
157157

158158
case ESP_GATTS_MTU_EVT:
159159
updatePeerMTU(param->mtu.conn_id, param->mtu.mtu);
160-
m_pServerCallbacks->onMtuChanged(this, param);
160+
if (m_pServerCallbacks != nullptr) {
161+
m_pServerCallbacks->onMtuChanged(this, param);
162+
}
161163
break;
162164

163165
// ESP_GATTS_CONNECT_EVT

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /