diff options
author | bshe <bshe@chromium.org> | 2015-11-18 14:42:45 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-18 22:43:44 +0000 |
commit | b4a8cf7a82ae168ea915d44f5997a7e756eca6c6 (patch) | |
tree | 3b849a5d14701061beb30fde8e7a458c427f4fe3 | |
parent | 893bf6a5ad8efee51a01b2d4fe1b09d4709165be (diff) | |
download | chromium_src-b4a8cf7a82ae168ea915d44f5997a7e756eca6c6.zip chromium_src-b4a8cf7a82ae168ea915d44f5997a7e756eca6c6.tar.gz chromium_src-b4a8cf7a82ae168ea915d44f5997a7e756eca6c6.tar.bz2 |
Add Nullity check for instant service
This code path is now also used by Android. And it may return null. So
add nullity check to avoid crash.
BUG=557285
Review URL: https://codereview.chromium.org/1456053002
Cr-Commit-Position: refs/heads/master@{#360433}
-rw-r--r-- | chrome/browser/ui/views/location_bar/location_bar_view.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index eb0f264..b8b4ea9 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -1241,8 +1241,10 @@ const char* LocationBarView::GetClassName() const { } void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { - InstantServiceFactory::GetForProfile(profile())->OnOmniboxStartMarginChanged( - bounds().x()); + InstantService* instant_service = + InstantServiceFactory::GetForProfile(profile()); + if (instant_service) + instant_service->OnOmniboxStartMarginChanged(bounds().x()); OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view(); if (popup->IsOpen()) |