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

Appearance settings

Commit 9eea85f

Browse filesBrowse files
authored
Check if m_pServerCallbacks is not null before calling method. (espressif#5603)
Fixes: espressif#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
Copy full SHA for 9eea85f

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎libraries/BLE/src/BLEServer.cpp

Copy file name to clipboardExpand all lines: libraries/BLE/src/BLEServer.cpp
+3-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.