Check the return value of UIT_CreatePopupWindow() in UIT_ShowDevTools() to avoid a crash when canceling the popup window (issue #285).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@274 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2011-08-03 16:59:21 +00:00
parent dadd852cd3
commit f0d1898928
1 changed files with 5 additions and 3 deletions

View File

@ -1424,9 +1424,11 @@ void CefBrowserImpl::UIT_ShowDevTools()
CefPopupFeatures features;
CefRefPtr<CefBrowserImpl> browser = UIT_CreatePopupWindow(url, features);
browser->UIT_CreateDevToolsClient(dev_tools_agent_.get());
browser->UIT_LoadURL(browser->GetMainFrame(), url);
browser->UIT_Show(WebKit::WebNavigationPolicyNewWindow);
if (browser.get()) {
browser->UIT_CreateDevToolsClient(dev_tools_agent_.get());
browser->UIT_LoadURL(browser->GetMainFrame(), url);
browser->UIT_Show(WebKit::WebNavigationPolicyNewWindow);
}
} else {
// Give focus to the existing inspector window.
client->browser()->UIT_Show(WebKit::WebNavigationPolicyNewWindow);