Skip to content

Commit

Permalink
Bug 1515970 - Don't access creditCards store in _updateSavedFieldName…
Browse files Browse the repository at this point in the history
…s unless it is enabled r=MattN

Differential Revision: https://phabricator.services.mozilla.com/D15393

--HG--
extra : moz-landing-system : lando
  • Loading branch information
timdream committed Jan 4, 2019
1 parent 91278a0 commit b89dfc0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions browser/extensions/formautofill/FormAutofillParent.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,15 @@ FormAutofillParent.prototype = {
_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);
Expand Down

0 comments on commit b89dfc0

Please sign in to comment.