Reland "Implement rollback for setRemoteDescription"
This is a reland of 16d4c4d4fbb8644033def1091d2d5c941c1b01fa after
downstream project was updated to be prepared for the new SdpType.
Original change's description:
> Implement rollback for setRemoteDescription
>
> Bug: chromium:980875
> Change-Id: I4575e9ad1902a20937f9812f49edee2a2441f76d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153525
> Commit-Queue: Eldar Rello <elrello@microsoft.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29422}
TBR=steveanton@webrtc.org
Bug: chromium:980875
Change-Id: Iba8d25bf2dc481b25a03eeae9818bd5f4c3eaa2d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156569
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29460}
diff --git a/pc/sdp_utils.cc b/pc/sdp_utils.cc
index 5bfdaa4..f5385a6 100644
--- a/pc/sdp_utils.cc
+++ b/pc/sdp_utils.cc
@@ -29,8 +29,10 @@
SdpType type) {
RTC_DCHECK(sdesc);
auto clone = std::make_unique<JsepSessionDescription>(type);
- clone->Initialize(sdesc->description()->Clone(), sdesc->session_id(),
- sdesc->session_version());
+ if (sdesc->description()) {
+ clone->Initialize(sdesc->description()->Clone(), sdesc->session_id(),
+ sdesc->session_version());
+ }
// As of writing, our version of GCC does not allow returning a unique_ptr of
// a subclass as a unique_ptr of a base class. To get around this, we need to
// std::move the return value.