Index: third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp |
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp |
index 29bf7918ae5ab5ca4357eca0d421c5900520494e..ddfa8df5f19214e856a3ba6cca40bdc185ed6dd7 100644 |
--- a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp |
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp |
@@ -25,6 +25,7 @@ |
#include "modules/peerconnection/RTCDataChannel.h" |
#include <memory> |
+#include <utility> |
#include "bindings/core/v8/ExceptionState.h" |
#include "core/dom/DOMArrayBuffer.h" |
#include "core/dom/DOMArrayBufferView.h" |
@@ -244,7 +245,8 @@ void RTCDataChannel::send(Blob* data, ExceptionState& exception_state) { |
} |
void RTCDataChannel::close() { |
- handler_->Close(); |
+ if (handler_) |
+ handler_->Close(); |
} |
void RTCDataChannel::DidChangeReadyState( |
@@ -319,6 +321,7 @@ void RTCDataChannel::ContextDestroyed(ExecutionContext*) { |
stopped_ = true; |
handler_->SetClient(nullptr); |
handler_.reset(); |
+ ready_state_ = kReadyStateClosed; |
} |
// ActiveScriptWrappable |