Bug 1591199: Don't assert when a candidate is gathered for a transceiver that is not associated, since that can happen in certain rollback scenarios. r=mjf

Depends on D60308

Differential Revision: https://phabricator.services.mozilla.com/D60309

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Byron Campen [:bwc] 2020-01-22 02:49:47 +00:00
Родитель c643dbf3ec
Коммит c035458265
1 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -2083,22 +2083,18 @@ nsresult JsepSessionImpl::AddLocalIceCandidate(const std::string& candidate,
std::string* mid,
bool* skipped) {
mLastError.clear();
*skipped = true;
if (!mCurrentLocalDescription && !mPendingLocalDescription) {
JSEP_SET_ERROR("Cannot add ICE candidate when there is no local SDP");
return NS_ERROR_UNEXPECTED;
}
JsepTransceiver* transceiver = GetTransceiverWithTransport(transportId);
*skipped = !transceiver;
if (*skipped) {
if (!transceiver || !transceiver->IsAssociated()) {
// mainly here to make some testing less complicated, but also just in case
return NS_OK;
}
MOZ_ASSERT(
transceiver->IsAssociated(),
"ICE candidate was gathered before the transceiver was associated! "
"This should never happen.");
*level = transceiver->GetLevel();
*mid = transceiver->GetMid();
@ -2115,6 +2111,7 @@ nsresult JsepSessionImpl::AddLocalIceCandidate(const std::string& candidate,
*level, ufrag);
}
*skipped = false;
return rv;
}