Skip to content

Commit

Permalink
report error if missing pref for ID in preference attribute
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: Kbjkcj9M9lx
  • Loading branch information
mykmelez committed Dec 20, 2017
1 parent 893c7b9 commit 3f8c1a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion toolkit/content/preferencesBindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ const Preferences = window.Preferences = (function() {
const element = elements[i];
const id = element.getAttribute("preference");
const pref = this.get(id);
pref.setElementValue(element);
if (pref) {
pref.setElementValue(element);
} else {
console.error(`Missing preference for ID ${id}`);
}
}
},

Expand Down

0 comments on commit 3f8c1a6

Please sign in to comment.