summaryrefslogtreecommitdiffstats
path: root/chrome/browser/metrics/metrics_log.cc
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-01 12:06:26 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-01 12:06:26 +0000
commit24c935e51901ea20ac90d9b58491d0359c0c5642 (patch)
tree8a0d9a5351e8ba0a5b62a82706c99d10bbf55f03 /chrome/browser/metrics/metrics_log.cc
parent8751ece7cf913f3a89499b2d56f18fcce9eb6c32 (diff)
downloadchromium_src-24c935e51901ea20ac90d9b58491d0359c0c5642.zip
chromium_src-24c935e51901ea20ac90d9b58491d0359c0c5642.tar.gz
chromium_src-24c935e51901ea20ac90d9b58491d0359c0c5642.tar.bz2
Don't log plugin enabled state when there is no profile.
BUG=94335 TEST=no crash Review URL: http://codereview.chromium.org/7792038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99172 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/metrics/metrics_log.cc')
-rw-r--r--chrome/browser/metrics/metrics_log.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index fc5fc76..d0bffb0 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -276,8 +276,10 @@ void MetricsLog::WritePluginList(
DCHECK(!locked_);
ProfileManager* profile_manager = g_browser_process->profile_manager();
- PluginPrefs* plugin_prefs =
- PluginPrefs::GetForProfile(profile_manager->GetLoadedProfiles().front());
+ std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles();
+ PluginPrefs* plugin_prefs = NULL;
+ if (!profiles.empty())
+ plugin_prefs = PluginPrefs::GetForProfile(profiles.front());
OPEN_ELEMENT_FOR_SCOPE("plugins");
@@ -297,7 +299,8 @@ void MetricsLog::WritePluginList(
#endif
WriteAttribute("filename", CreateBase64Hash(filename_bytes));
WriteAttribute("version", UTF16ToUTF8(iter->version));
- WriteIntAttribute("disabled", !plugin_prefs->IsPluginEnabled(*iter));
+ if (plugin_prefs)
+ WriteIntAttribute("disabled", !plugin_prefs->IsPluginEnabled(*iter));
}
}