diff --git a/libcef/browser/devtools/devtools_frontend.cc b/libcef/browser/devtools/devtools_frontend.cc index 0d4e6605c..9a94ec99b 100644 --- a/libcef/browser/devtools/devtools_frontend.cc +++ b/libcef/browser/devtools/devtools_frontend.cc @@ -532,8 +532,10 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( void CefDevToolsFrontend::DispatchProtocolMessage( content::DevToolsAgentHost* agent_host, base::span message) { - if (frontend_browser_->GetWebContents()->IsBeingDestroyed()) + if (!frontend_browser_->GetWebContents() || + frontend_browser_->GetWebContents()->IsBeingDestroyed()) { return; + } base::StringPiece str_message(reinterpret_cast(message.data()), message.size());