Check embedder_message_dispatcher_ before sending a message

HandleMessageFromDevToolsFrontend() might be called
after the WebContentsDestroyed() is.
This commit is contained in:
Aleksei Kuzmin 2018-05-29 17:42:15 +02:00 committed by Samuel Attard
parent 6481161ef2
commit 622544a902

View file

@ -617,6 +617,11 @@ void InspectableWebContentsImpl::RegisterExtensionsAPI(
void InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend(
const std::string& message) {
// TODO(alexeykuzmin): Should we expect it to exist?
if (!embedder_message_dispatcher_) {
return;
}
std::string method;
base::ListValue empty_params;
base::ListValue* params = &empty_params;