diff options
author | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-13 16:13:02 +0000 |
---|---|---|
committer | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-13 16:13:02 +0000 |
commit | 713d4e9d556633ec06c2e5da790e77e919ad1adc (patch) | |
tree | 13212a389c952d1b411da6f794cf032b22533b41 /chrome/browser | |
parent | dd17e9ebd1f1d5e3c3599edbf33b22efe1346d92 (diff) | |
download | chromium_src-713d4e9d556633ec06c2e5da790e77e919ad1adc.zip chromium_src-713d4e9d556633ec06c2e5da790e77e919ad1adc.tar.gz chromium_src-713d4e9d556633ec06c2e5da790e77e919ad1adc.tar.bz2 |
Fix a crash when with chrome-ui://about/" or anything invalid
If DOMUIContents::InitCurrentUI returns true then current_ui_
should always be valid. Changed logic inside to make sure that
this is the case.
Review URL: http://codereview.chromium.org/46009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/dom_ui/dom_ui_contents.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/browser/dom_ui/dom_ui_contents.cc b/chrome/browser/dom_ui/dom_ui_contents.cc index f27d441..4fe32d1 100644 --- a/chrome/browser/dom_ui/dom_ui_contents.cc +++ b/chrome/browser/dom_ui/dom_ui_contents.cc @@ -194,7 +194,7 @@ bool DOMUIContents::IsBookmarkBarAlwaysVisible() { void DOMUIContents::SetInitialFocus() { if (InitCurrentUI(false)) current_ui_->SetInitialFocus(); - else + else if (current_ui_) current_ui_->get_contents()->view()->SetInitialFocus(); } @@ -257,11 +257,11 @@ bool DOMUIContents::InitCurrentUI(bool reload) { if (current_ui_) { current_ui_->Init(); current_url_ = url; - return true; } - } else if (current_ui_) { + } + + if (current_ui_) return true; - } return false; } |