From f0d189892878a185460691274b7d32fbf3d66b40 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 3 Aug 2011 16:59:21 +0000 Subject: [PATCH] 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 --- libcef/browser_impl.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libcef/browser_impl.cc b/libcef/browser_impl.cc index 16a6bb0c0..bb2d46ff6 100644 --- a/libcef/browser_impl.cc +++ b/libcef/browser_impl.cc @@ -1424,9 +1424,11 @@ void CefBrowserImpl::UIT_ShowDevTools() CefPopupFeatures features; CefRefPtr 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);