summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_controller_mac.mm
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-03 21:23:58 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-03 21:23:58 +0000
commit446e16abd172481d860480ca40995edd4fa708e2 (patch)
tree56df044e240b7206ce78a2c9923e8a5e9a4e63d0 /chrome/browser/app_controller_mac.mm
parentc78a459365df4c9c91ed3ebd4a99cfddea7b258a (diff)
downloadchromium_src-446e16abd172481d860480ca40995edd4fa708e2.zip
chromium_src-446e16abd172481d860480ca40995edd4fa708e2.tar.gz
chromium_src-446e16abd172481d860480ca40995edd4fa708e2.tar.bz2
added workaround for NULL defaultProfile in app_controller_mac.mm.
BUG=43048 TEST=manual, although couldn't repro original problem Review URL: http://codereview.chromium.org/1845002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46275 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r--chrome/browser/app_controller_mac.mm26
1 files changed, 24 insertions, 2 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 8a1e189..824b1b4 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -625,10 +625,23 @@ void RecordLastRunAppBundlePath() {
case IDC_NEW_TAB:
enable = [self keyWindowIsMissingOrBlocked];
break;
- case IDC_SYNC_BOOKMARKS:
+ case IDC_SYNC_BOOKMARKS: {
+ Profile* defaultProfile = [self defaultProfile];
+ // The profile may be NULL during shutdown -- see
+ // http://code.google.com/p/chromium/issues/detail?id=43048 .
+ //
+ // TODO(akalin,viettrungluu): Figure out whether this method
+ // can be prevented from being called if defaultProfile is
+ // NULL.
+ if (!defaultProfile) {
+ LOG(WARNING)
+ << "NULL defaultProfile detected -- not doing anything";
+ break;
+ }
enable = ProfileSyncService::IsSyncEnabled();
- sync_ui_util::UpdateSyncItem(item, enable, [self defaultProfile]);
+ sync_ui_util::UpdateSyncItem(item, enable, defaultProfile);
break;
+ }
default:
enable = menuState_->IsCommandEnabled(tag) ? YES : NO;
}
@@ -753,6 +766,15 @@ void RecordLastRunAppBundlePath() {
break;
}
case IDC_SYNC_BOOKMARKS:
+ // The profile may be NULL during shutdown -- see
+ // http://code.google.com/p/chromium/issues/detail?id=43048 .
+ //
+ // TODO(akalin,viettrungluu): Figure out whether this method can
+ // be prevented from being called if defaultProfile is NULL.
+ if (!defaultProfile) {
+ LOG(WARNING) << "NULL defaultProfile detected -- not doing anything";
+ break;
+ }
// TODO(akalin): Add a constant to denote starting sync from the
// main menu and use that instead of START_FROM_WRENCH.
sync_ui_util::OpenSyncMyBookmarksDialog(