|
@@ -867,6 +867,11 @@ void PeerConnection::processLocalDescription(Description description) {
|
|
|
description.addMedia(std::move(media));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // There might be no media at this point if the user created a Track, deleted it,
|
|
|
+ // then called setLocalDescription().
|
|
|
+ if (description.mediaCount() == 0)
|
|
|
+ throw std::runtime_error("No DataChannel or Track to negotiate");
|
|
|
}
|
|
|
|
|
|
// Set local fingerprint (wait for certificate if necessary)
|
|
@@ -874,6 +879,9 @@ void PeerConnection::processLocalDescription(Description description) {
|
|
|
|
|
|
PLOG_VERBOSE << "Issuing local description: " << description;
|
|
|
|
|
|
+ if (description.mediaCount() == 0)
|
|
|
+ throw std::logic_error("Local description has no media line");
|
|
|
+
|
|
|
{
|
|
|
// Set as local description
|
|
|
std::lock_guard lock(mLocalDescriptionMutex);
|