Fix crash in CefResourceDispatcherHostDelegate::HandleExternalProtocol when destroying a browser during redirect (issue #1941)

This commit is contained in:
Marshall Greenblatt
2016-07-08 15:28:53 -04:00
parent 8a5e7a1270
commit a22b11d764
2 changed files with 69 additions and 5 deletions

View File

@@ -97,10 +97,12 @@ bool CefResourceDispatcherHostDelegate::HandleExternalProtocol(
}
content::WebContents* web_contents = web_contents_getter.Run();
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser.get())
browser->HandleExternalProtocol(url);
if (web_contents) {
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser.get())
browser->HandleExternalProtocol(url);
}
return false;
}