Bug 584340 - nsIXMLHttpRequest.statusText in Blocklist.prototype.onXMLError
authortimeless@mozdev.org
Wed, 16 Feb 2011 14:14:16 +0100
changeset 62665 de4b86b6c74d7cde304194ec680dcad4f4bb1376
parent 62664 ca7bbf37c6d7a03d8264b86cb48ad6acf439e280
child 62666 4d4b3c0906e28c98bce1c9eda91d3811ad95161e
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
bugs584340
milestone2.0b12pre
Bug 584340 - nsIXMLHttpRequest.statusText in Blocklist.prototype.onXMLError r=robstrong a=beltzner
toolkit/mozapps/extensions/nsBlocklistService.js
--- a/toolkit/mozapps/extensions/nsBlocklistService.js
+++ b/toolkit/mozapps/extensions/nsBlocklistService.js
@@ -554,20 +554,24 @@ Blocklist.prototype = {
       var request = aEvent.target;
       // the following may throw (e.g. a local file or timeout)
       var status = request.status;
     }
     catch (e) {
       request = aEvent.target.channel.QueryInterface(Ci.nsIRequest);
       status = request.status;
     }
-    var statusText = request.statusText;
+    var statusText = "nsIXMLHttpRequest channel unavailable";
     // When status is 0 we don't have a valid channel.
-    if (status == 0)
-      statusText = "nsIXMLHttpRequest channel unavailable";
+    if (status != 0) {
+      try {
+        statusText = request.statusText;
+      } catch (e) {
+      }
+    }
     LOG("Blocklist:onError: There was an error loading the blocklist file\r\n" +
         statusText);
   },
 
   /**
    * Finds the newest blocklist file from the application and the profile and
    * load it or does nothing if neither exist.
    */