Bug 1397379 - getStringPref in clicktoplay-rollout addon throws for new profiles. r=mcastelluccio draft
authorFelipe Gomes <felipc@gmail.com>
Wed, 06 Sep 2017 15:33:57 -0300
changeset 660205 ba80f9976d8580a6bead138564c8aa8be9251054
parent 660203 b257be31873f29e513644bbbcd7cab427f71c292
child 730164 6cb1c321511c4ddcc8873f0353991535984b5d8d
push id78323
push userfelipc@gmail.com
push dateWed, 06 Sep 2017 18:34:22 +0000
reviewersmcastelluccio
bugs1397379
milestone57.0a1
Bug 1397379 - getStringPref in clicktoplay-rollout addon throws for new profiles. r=mcastelluccio MozReview-Commit-ID: GN0Cgl3jqK5
browser/extensions/clicktoplay-rollout/bootstrap.js
--- a/browser/extensions/clicktoplay-rollout/bootstrap.js
+++ b/browser/extensions/clicktoplay-rollout/bootstrap.js
@@ -41,17 +41,17 @@ function startup() {
 }
 
 function defineCohort() {
   let updateChannel = UpdateUtils.getUpdateChannel(false);
   if (!(updateChannel in TEST_THRESHOLD)) {
     return;
   }
 
-  let cohort = Services.prefs.getStringPref(PREF_COHORT_NAME);
+  let cohort = Services.prefs.getStringPref(PREF_COHORT_NAME, undefined);
 
   if (!cohort) {
     // The cohort has not been defined yet: this is the first
     // time that we're running. Let's see if the user has
     // a non-default setting to avoid changing it.
     let currentPluginState = Services.prefs.getIntPref(PREF_FLASH_STATE);
     switch (currentPluginState) {
       case Ci.nsIPluginTag.STATE_CLICKTOPLAY: