diff options
-rw-r--r-- | src/core/devtools_frontend_qt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp index 440c52d33..81701b631 100644 --- a/src/core/devtools_frontend_qt.cpp +++ b/src/core/devtools_frontend_qt.cpp @@ -296,7 +296,7 @@ void DevToolsFrontendQt::ReadyToCommitNavigation(content::NavigationHandle *navi // If the frontend for some reason goes to some place other than devtools, stop the bindings if (navigationHandle->GetURL() != GetFrontendURL()) m_frontendHost.reset(nullptr); - else + else if (!m_frontendHost) m_frontendHost = content::DevToolsFrontendHost::Create( frame, base::Bind(&DevToolsFrontendQt::HandleMessageFromDevToolsFrontend, @@ -488,6 +488,8 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me web_contents()->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([]);"), base::NullCallback()); } else if (method == "reattach") { + if (!m_agentHost) + return; m_agentHost->DetachClient(this); m_agentHost->AttachClient(this); } else if (method == "inspectedURLChanged" && params && params->GetSize() >= 1) { |