mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-10-22 14:01:24 +00:00
Guard enableNotifications against missing connection entry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
8013597a5f
commit
74def922a7
1 file changed
+4
-2
@@ -1906,9 +1906,11 @@ bool NimBLEPlatform::enableNotifications(uint16_t conn_handle, bool enable) {
|
||||
}
|
||||
|
||||
auto conn_it = _connections.find(conn_handle);
|
||||
if (conn_it != _connections.end()) {
|
||||
expected_peer = conn_it->second.peer_address;
|
||||
if (conn_it == _connections.end()) {
|
||||
xSemaphoreGive(_conn_mutex);
|
||||
return false;
|
||||
}
|
||||
expected_peer = conn_it->second.peer_address;
|
||||
|
||||
beginWriteOperation();
|
||||
xSemaphoreGive(_conn_mutex);
|
||||
|
||||
Reference in new issue
Block a user