summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_init.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-21 00:04:08 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-21 00:04:08 +0000
commit54dbf3b1b77a3d33f16cc4bf6efc9eec4404d4ef (patch)
tree221df906efb1150b315f6963d53cfffafe551de8 /chrome/browser/browser_init.cc
parentabb9a6376379aa3b9ce8356a10df1bde2e2ef058 (diff)
downloadchromium_src-54dbf3b1b77a3d33f16cc4bf6efc9eec4404d4ef.zip
chromium_src-54dbf3b1b77a3d33f16cc4bf6efc9eec4404d4ef.tar.gz
chromium_src-54dbf3b1b77a3d33f16cc4bf6efc9eec4404d4ef.tar.bz2
Fix Linux startup crash.
When there is no existing browser, this code will crash. It only works because of the Linux splash screen. Original review=http://codereview.chromium.org/155795 R=agl TEST=none Review URL: http://codereview.chromium.org/155822 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21131 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_init.cc')
-rw-r--r--chrome/browser/browser_init.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index 00db034..f7595a1 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -444,18 +444,20 @@ bool BrowserInit::LaunchWithProfile::Launch(Profile* profile,
if (!parsed_command_line.HasSwitch(switches::kHomePage) &&
GetURLsFromCommandLine(profile_).empty()) {
Browser* browser = BrowserList::GetLastActive();
- // Only show the splash page if it isn't already showing.
- bool open_splash = true;
- for (int i = 0; i < browser->tab_count(); ++i) {
- if (browser->GetTabContentsAt(i)->GetURL().spec() ==
- "about:linux-splash") {
- open_splash = false;
+ if (browser) {
+ // Only show the splash page if it isn't already showing.
+ bool open_splash = true;
+ for (int i = 0; i < browser->tab_count(); ++i) {
+ if (browser->GetTabContentsAt(i)->GetURL().spec() ==
+ "about:linux-splash") {
+ open_splash = false;
+ }
}
- }
- if (open_splash) {
- browser->OpenURL(GURL("about:linux-splash"), GURL(),
- NEW_FOREGROUND_TAB, PageTransition::START_PAGE);
+ if (open_splash) {
+ browser->OpenURL(GURL("about:linux-splash"), GURL(),
+ NEW_FOREGROUND_TAB, PageTransition::START_PAGE);
+ }
}
}
#endif