Fix crash closing DevTools window (fixes issue #3111)

This commit is contained in:
Marshall Greenblatt 2021-05-05 12:48:07 -04:00
parent 820ef6c323
commit fde96be168
1 changed files with 3 additions and 1 deletions

View File

@ -532,8 +532,10 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
void CefDevToolsFrontend::DispatchProtocolMessage(
content::DevToolsAgentHost* agent_host,
base::span<const uint8_t> message) {
if (frontend_browser_->GetWebContents()->IsBeingDestroyed())
if (!frontend_browser_->GetWebContents() ||
frontend_browser_->GetWebContents()->IsBeingDestroyed()) {
return;
}
base::StringPiece str_message(reinterpret_cast<const char*>(message.data()),
message.size());