diff --git a/internal/platform/implementation/g3/ble_v2.cc b/internal/platform/implementation/g3/ble_v2.cc index 4213e3b3..2b9b5e71 100644 --- a/internal/platform/implementation/g3/ble_v2.cc +++ b/internal/platform/implementation/g3/ble_v2.cc @@ -501,7 +501,7 @@ std::unique_ptr 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=" diff --git a/internal/platform/implementation/g3/wifi_hotspot.cc b/internal/platform/implementation/g3/wifi_hotspot.cc index a772ea74..6d39add7 100644 --- a/internal/platform/implementation/g3/wifi_hotspot.cc +++ b/internal/platform/implementation/g3/wifi_hotspot.cc @@ -273,7 +273,8 @@ std::unique_ptr 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="