diff options
author | sreeram@chromium.org <sreeram@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-17 18:33:41 +0000 |
---|---|---|
committer | sreeram@chromium.org <sreeram@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-17 18:33:41 +0000 |
commit | 71739aad68e647b360158e72cf4aeddf5f2490d0 (patch) | |
tree | ceba6bcf50ae4ed8bc4f2da89399d7a2dc319614 /chrome/browser/instant/instant_controller.cc | |
parent | fc1f78f05bd43e25b2c1a7d92c71450d9fcd9c88 (diff) | |
download | chromium_src-71739aad68e647b360158e72cf4aeddf5f2490d0.zip chromium_src-71739aad68e647b360158e72cf4aeddf5f2490d0.tar.gz chromium_src-71739aad68e647b360158e72cf4aeddf5f2490d0.tar.bz2 |
Crash fix.
I don't see how tab_contents_ could be NULL inside PrepareForCommit().
Even if Update() had never been called, OnAutocompleteGotFocus() should
have set a valid tab_contents_. Anyway, check for it before trying to
access the profile().
BUG=100521
TEST=none
Review URL: http://codereview.chromium.org/8322005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105858 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant/instant_controller.cc')
-rw-r--r-- | chrome/browser/instant/instant_controller.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc index 538fa1c..a186a74 100644 --- a/chrome/browser/instant/instant_controller.cc +++ b/chrome/browser/instant/instant_controller.cc @@ -232,8 +232,10 @@ bool InstantController::IsCurrent() { bool InstantController::PrepareForCommit() { // If we are not in the HIDDEN field trial, return the status of the preview. - if (!InstantFieldTrial::IsHiddenExperiment(tab_contents_->profile())) + if (!tab_contents_ || + !InstantFieldTrial::IsHiddenExperiment(tab_contents_->profile())) { return IsCurrent(); + } TemplateURLService* model = TemplateURLServiceFactory::GetForProfile( tab_contents_->profile()); |