diff options
author | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 19:49:07 +0000 |
---|---|---|
committer | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 19:49:07 +0000 |
commit | 3d17ea8af46488f32bade8594b8c345fb837fc9a (patch) | |
tree | ffdf179d7d031f3e222b6e1cb2f78b23bf44b563 | |
parent | 2c39a8b574013340dd6ae2c2587b273f3d1d4c48 (diff) | |
download | chromium_src-3d17ea8af46488f32bade8594b8c345fb837fc9a.zip chromium_src-3d17ea8af46488f32bade8594b8c345fb837fc9a.tar.gz chromium_src-3d17ea8af46488f32bade8594b8c345fb837fc9a.tar.bz2 |
Fixing crash when opening a new browser
BUG=chromium-os:5147,chromium-os:5997
TEST=none
Review URL: http://codereview.chromium.org/3113033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57566 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/usb_mount_observer.cc | 6 | ||||
-rw-r--r-- | chrome/browser/dom_ui/filebrowse_ui.cc | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/chromeos/usb_mount_observer.cc b/chrome/browser/chromeos/usb_mount_observer.cc index 200ed85..1bb559d 100644 --- a/chrome/browser/chromeos/usb_mount_observer.cc +++ b/chrome/browser/chromeos/usb_mount_observer.cc @@ -53,7 +53,11 @@ void USBMountObserver::OpenFileBrowse(const std::string& url, bool small) { Browser* browser; Profile* profile; - profile = BrowserList::GetLastActive()->profile(); + browser = BrowserList::GetLastActive(); + if (browser == NULL) { + return; + } + profile = browser->profile(); PrefService* pref_service = profile->GetPrefs(); if (!pref_service->GetBoolean(prefs::kLabsAdvancedFilesystemEnabled)) { return; diff --git a/chrome/browser/dom_ui/filebrowse_ui.cc b/chrome/browser/dom_ui/filebrowse_ui.cc index 1620fd3..0e074a8 100644 --- a/chrome/browser/dom_ui/filebrowse_ui.cc +++ b/chrome/browser/dom_ui/filebrowse_ui.cc @@ -999,7 +999,11 @@ Browser* FileBrowseUI::OpenPopup(Profile* profile, Browser* FileBrowseUI::GetPopupForPath(const std::string& path) { std::string current_path = path; if (current_path.empty()) { - Profile* profile = BrowserList::GetLastActive()->profile(); + Browser* browser = BrowserList::GetLastActive(); + if (browser == NULL) { + return NULL; + } + Profile* profile = browser->profile(); PrefService* pref_service = profile->GetPrefs(); bool is_enabled = pref_service->GetBoolean( prefs::kLabsAdvancedFilesystemEnabled); |