Bug 1515970 - Don't access creditCards store in _updateSavedFieldNames unless it is enabled r=MattN
authorTimothy Guan-tin Chien <timdream@gmail.com>
Fri, 04 Jan 2019 16:12:43 +0000
changeset 452578 606aa2a9d0b28592538bbf77405ac10dda993df0
parent 452577 35dc9703f35828c01e960e5d1e52fc96620afd85
child 452579 92f9e0296e6270f507f6b36aa7038b6d03ba2a04
push id35315
push usershindli@mozilla.com
push dateSat, 05 Jan 2019 03:59:26 +0000
treeherdermozilla-central@6dd228164d42 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1515970
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1515970 - Don't access creditCards store in _updateSavedFieldNames unless it is enabled r=MattN Differential Revision: https://phabricator.services.mozilla.com/D15393
browser/extensions/formautofill/FormAutofillParent.jsm
--- a/browser/extensions/formautofill/FormAutofillParent.jsm
+++ b/browser/extensions/formautofill/FormAutofillParent.jsm
@@ -348,19 +348,25 @@ FormAutofillParent.prototype = {
     }
 
     target.sendAsyncMessage("FormAutofill:Records", records);
   },
 
   _updateSavedFieldNames() {
     log.debug("_updateSavedFieldNames");
 
-    Services.ppmm.initialProcessData.autofillSavedFieldNames =
-      new Set([...this.formAutofillStorage.addresses.getSavedFieldNames(),
-        ...this.formAutofillStorage.creditCards.getSavedFieldNames()]);
+    // Don't access the credit cards store unless it is enabled.
+    if (FormAutofill.isAutofillCreditCardsAvailable) {
+      Services.ppmm.initialProcessData.autofillSavedFieldNames =
+        new Set([...this.formAutofillStorage.addresses.getSavedFieldNames(),
+          ...this.formAutofillStorage.creditCards.getSavedFieldNames()]);
+    } else {
+      Services.ppmm.initialProcessData.autofillSavedFieldNames =
+        this.formAutofillStorage.addresses.getSavedFieldNames();
+    }
 
     Services.ppmm.broadcastAsyncMessage("FormAutofill:savedFieldNames",
                                         Services.ppmm.initialProcessData.autofillSavedFieldNames);
     this._updateStatus();
   },
 
   async _onAddressSubmit(address, target, timeStartedFillingMS) {
     let showDoorhanger = null;