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

Unified Diff: components/variations/variations_seed_processor.cc

Issue 529183002: Fix crash with forcing variations when the trial exists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | components/variations/variations_seed_processor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/variations_seed_processor.cc
diff --git a/components/variations/variations_seed_processor.cc b/components/variations/variations_seed_processor.cc
index 32f93fc8cecdd4257040dd925101e6dae99e08da..e60db0df6eada099811a01e49c7ab33174c205af 100644
--- a/components/variations/variations_seed_processor.cc
+++ b/components/variations/variations_seed_processor.cc
@@ -111,6 +111,13 @@ void VariationsSeedProcessor::CreateTrialFromStudy(
scoped_refptr<base::FieldTrial> trial(
base::FieldTrialList::CreateFieldTrial(study.name(),
experiment.name()));
+ // If |trial| is NULL, then there might already be a trial forced to a
+ // different group (e.g. via --force-fieldtrials). Break out of the loop,
+ // but don't return, so that variation ids and params for the selected
+ // group will still be picked up.
+ if (!trial)
+ break;
+
RegisterExperimentParams(study, experiment);
RegisterVariationIds(experiment, study.name());
if (study.activation_type() == Study_ActivationType_ACTIVATION_AUTO) {
« no previous file with comments | « no previous file | components/variations/variations_seed_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698