[Pkg-mozext-commits] [greasemonkey] 02/06: Gracefully handle exceptions when parsing config.xml.

David Prévot taffit at moszumanska.debian.org
Fri Apr 18 13:28:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit 02ac779461b4d01141447fbd894c139bfbcb6a5b
Author: Ventero <ventero at ventero.de>
Date:   Sun Apr 13 03:32:16 2014 +0200

    Gracefully handle exceptions when parsing config.xml.
    
    Refs #1912.
---
 content/config.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/content/config.js b/content/config.js
index 95659eb..abce40c 100644
--- a/content/config.js
+++ b/content/config.js
@@ -77,7 +77,13 @@ Config.prototype._load = function() {
 
   this._scripts = [];
   for (var i=0, node=null; node=nodes.snapshotItem(i); i++) {
-    var script = new Script(node);
+    try {
+      var script = new Script(node);
+    } catch (e) {
+      // If parsing the script node failed, fail gracefully by skipping it.
+      GM_util.logError(e, false, e.fileName, e.lineNumber);
+      continue;
+    }
     if (script.allFilesExist()) {
       this._scripts.push(script);
     } else {

-- 
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