Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
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 9d19ce3b25a624e5f69cff4df39210adeb33c9f4..c826d3dc976344dadd7d34ecc4dec1f0e4d61042 100644 |
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
@@ -1274,8 +1274,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()) |