Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3685)

Unified Diff: chrome/browser/ui/search/instant_page.cc

Issue 22043004: Check for null on Browser pointer to address crash report. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/instant_page.cc
diff --git a/chrome/browser/ui/search/instant_page.cc b/chrome/browser/ui/search/instant_page.cc
index e7a52752e499490ad950de8e43869b82e7bd0788..f963d2df5384b3de64a06d3fb05ccd2a5f4fb756 100644
--- a/chrome/browser/ui/search/instant_page.cc
+++ b/chrome/browser/ui/search/instant_page.cc
@@ -300,9 +300,12 @@ void InstantPage::MaybeRemoveMostVisitedItems(
if (!history::MostVisitedTilesExperiment::IsDontShowOpenURLsEnabled())
return;
- TabStripModel* tab_strip_model = chrome::FindBrowserWithProfile(
- profile_,
- chrome::GetActiveDesktop())->tab_strip_model();
+ Browser* browser = chrome::FindBrowserWithProfile(profile_,
+ chrome::GetActiveDesktop());
+ if (!browser)
+ return;
+
+ TabStripModel* tab_strip_model = browser->tab_strip_model();
history::TopSites* top_sites = profile_->GetTopSites();
if (!tab_strip_model || !top_sites) {
NOTREACHED();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698