Don't call current_remote_description before exchange completes.
Bug: 277377045
Test: locally
Change-Id: I718651bc7859be49721024cc9ec1f50a2c881bee
diff --git a/host/frontend/webrtc/libcommon/connection_controller.cpp b/host/frontend/webrtc/libcommon/connection_controller.cpp
index 18dbfb1..c776258 100644
--- a/host/frontend/webrtc/libcommon/connection_controller.cpp
+++ b/host/frontend/webrtc/libcommon/connection_controller.cpp
@@ -157,7 +157,7 @@
Result<void> ConnectionController::OnIceCandidateMsg(
std::unique_ptr<webrtc::IceCandidateInterface> candidate) {
- if (peer_connection_->current_remote_description()) {
+ if (peer_connection_->remote_description()) {
peer_connection_->AddIceCandidate(
std::move(candidate), [this](webrtc::RTCError error) {
if (!error.ok()) {
@@ -222,7 +222,7 @@
return;
}
AddPendingIceCandidates();
- auto remote_desc = peer_connection_->current_remote_description();
+ auto remote_desc = peer_connection_->remote_description();
CHECK(remote_desc) << "The remote description was just added successfully in "
"this thread, so it can't be nullptr";
if (remote_desc->GetType() != webrtc::SdpType::kOffer) {