diff --git a/internal/platform/implementation/g3/bluetooth_classic.cc b/internal/platform/implementation/g3/bluetooth_classic.cc index 4fda2891..aee2e674 100644 --- a/internal/platform/implementation/g3/bluetooth_classic.cc +++ b/internal/platform/implementation/g3/bluetooth_classic.cc @@ -218,7 +218,7 @@ std::unique_ptr BluetoothClassicMedium::ConnectToService( { absl::MutexLock medium_lock(&medium->mutex_); auto item = medium->sockets_.find(service_uuid); - server_socket = item != sockets_.end() ? item->second : nullptr; + server_socket = item != medium->sockets_.end() ? item->second : nullptr; if (server_socket == nullptr) { NEARBY_LOGS(ERROR) << "Failed to find BT Server socket: uuid=" << service_uuid; diff --git a/internal/platform/implementation/g3/wifi_direct.cc b/internal/platform/implementation/g3/wifi_direct.cc index f1fc4af3..0b77bf33 100644 --- a/internal/platform/implementation/g3/wifi_direct.cc +++ b/internal/platform/implementation/g3/wifi_direct.cc @@ -265,7 +265,8 @@ std::unique_ptr WifiDirectMedium::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 WifiDirect Failed to find WifiDirect Server " "socket: socket_name="