[Pkg-mozext-commits] [greasemonkey] 04/62: Prevent `TypeError: matches is undefined` in Sync.
David Prévot
taffit at moszumanska.debian.org
Sun Sep 13 22:10:19 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository greasemonkey.
commit 0792f2961279e23c904accb1c335b2b40e64ef1f
Author: Anthony Lieuallen <arantius at gmail.com>
Date: Fri Jul 31 15:57:12 2015 -0400
Prevent `TypeError: matches is undefined` in Sync.
I.e. from an old Sync record which did not specify user matches. Default to nothing.
Fixes #2188
---
modules/sync.js | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/modules/sync.js b/modules/sync.js
index 108d5f1..64c71ce 100644
--- a/modules/sync.js
+++ b/modules/sync.js
@@ -1,10 +1,11 @@
var EXPORTED_SYMBOLS = [];
-(function initSync() {
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
+(function initSync() {
+
Cu.import('resource://gre/modules/Services.jsm');
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
@@ -208,10 +209,10 @@ ScriptStore.prototype = {
if (!aRecord.cleartext.installed) {
script.uninstall();
} else {
- script.enabled = aRecord.cleartext.enabled;
- script.userExcludes = aRecord.cleartext.userExcludes;
- script.userMatches = aRecord.cleartext.userMatches;
- script.userIncludes = aRecord.cleartext.userIncludes;
+ script.enabled = !!aRecord.cleartext.enabled;
+ script.userExcludes = aRecord.cleartext.userExcludes || [];
+ script.userMatches = aRecord.cleartext.userMatches || [];
+ script.userIncludes = aRecord.cleartext.userIncludes || [];
setScriptValuesFromSyncRecord(script, aRecord);
}
},
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git
More information about the Pkg-mozext-commits
mailing list