mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Fix a bug in which an iterator is compared to an end iterator from a different hashtable.
PiperOrigin-RevId: 501928248
This commit is contained in:
@@ -501,7 +501,7 @@ std::unique_ptr<api::ble_v2::BleSocket> BleV2Medium::Connect(
|
||||
absl::MutexLock medium_lock(&remote_medium->mutex_);
|
||||
auto item = remote_medium->server_sockets_.find(service_id);
|
||||
remote_server_socket =
|
||||
item != server_sockets_.end() ? item->second : nullptr;
|
||||
item != remote_medium->server_sockets_.end() ? item->second : nullptr;
|
||||
if (remote_server_socket == nullptr) {
|
||||
NEARBY_LOGS(ERROR)
|
||||
<< "G3 Ble Failed to find Ble Server socket: service_id="
|
||||
|
||||
@@ -273,7 +273,8 @@ std::unique_ptr<api::WifiHotspotSocket> WifiHotspotMedium::ConnectToService(
|
||||
{
|
||||
absl::MutexLock medium_lock(&remote_medium->mutex_);
|
||||
auto item = remote_medium->server_sockets_.find(socket_name);
|
||||
server_socket = item != server_sockets_.end() ? item->second : nullptr;
|
||||
server_socket =
|
||||
item != remote_medium->server_sockets_.end() ? item->second : nullptr;
|
||||
if (server_socket == nullptr) {
|
||||
NEARBY_LOGS(ERROR) << "G3 WifiHotspot Failed to find WifiHotspot Server "
|
||||
"socket: socket_name="
|
||||
|
||||
Reference in New Issue
Block a user