[Pkg-mozext-commits] [greasemonkey] 48/55: Ignore errors in _updateVersion().

David Prévot taffit at moszumanska.debian.org
Thu Oct 29 15:38:07 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 04f3990de767ffbc253f2a268bec917d7796b964
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Fri Oct 16 15:56:33 2015 -0400

    Ignore errors in _updateVersion().
    
    Plus ignore errors in showGrantWarning(); it's better to miss the warning than the entire (update) action.
    
    Fixes #2294
---
 content/config.js | 6 +++++-
 modules/script.js | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/content/config.js b/content/config.js
index 5fb421a..d0f1e0a 100644
--- a/content/config.js
+++ b/content/config.js
@@ -301,7 +301,11 @@ Config.prototype._updateVersion = function() {
       for (var i = 0, script = null; script = this._scripts[i]; i++) {
         var parsedScript = scope.parse(
             script.textContent, GM_util.uriFromUrl(script.downloadURL));
-        script.updateFromNewScript(parsedScript);
+        try {
+          script.updateFromNewScript(parsedScript);
+        } catch (e) {
+          // Ignore.
+        }
       }
     }
   }));
diff --git a/modules/script.js b/modules/script.js
index 6ccddd7..099326f 100644
--- a/modules/script.js
+++ b/modules/script.js
@@ -789,6 +789,10 @@ Script.prototype.showGrantWarning = function () {
   }
   var getString = stringBundle.GetStringFromName;
   var chromeWin = GM_util.getBrowserWindow();
+  if (!chromeWin) {
+    // Ignore, this is probably a startup issue like #2294.
+    return;
+  }
 
   function muteWarnings() {
     GM_prefRoot.setValue('showGrantsWarning', false);

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