Closed Bug 584340 Opened 9 years ago Closed 9 years ago

nsIXMLHttpRequest.statusText in Blocklist.prototype.onXMLError

Categories

(Toolkit :: Safe Browsing, defect)

x86
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 4.0b12

People

(Reporter: timeless, Assigned: timeless)

Details

Attachments

(1 file, 1 obsolete file)

1.01 KB, patch
timeless
: review+
beltzner
: approval2.0+
Details | Diff | Splinter Review
Error: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.statusText]"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: file:///C:/build/dbg-firefox-i686-pc-mingw32/dist/bin/components/nsBlocklistService.js :: anonymous :: line 470"  data: no]
Source File: file:///C:/build/dbg-firefox-i686-pc-mingw32/dist/bin/components/nsBlocklistService.js

This should either be guarded by some other value or just stuck in a try block.

It happens to me because my network isn't really up.
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #463327 - Flags: review?(robert.bugzilla)
Comment on attachment 463327 [details] [diff] [review]
patch

>diff --git a/toolkit/mozapps/extensions/nsBlocklistService.js b/toolkit/mozapps/extensions/nsBlocklistService.js
>--- a/toolkit/mozapps/extensions/nsBlocklistService.js
>+++ b/toolkit/mozapps/extensions/nsBlocklistService.js
>@@ -512,10 +512,14 @@ Blocklist.prototype = {
>       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 {
>+        let requestStatusText = request.statusText;
>+        statusText = requestStatusText;
You should be able to just do
statusText = request.statusText;

r=me with that
Attachment #463327 - Flags: review?(robert.bugzilla) → review+
Comment on attachment 463327 [details] [diff] [review]
patch

>+    if (status != 0) {
>+      try {
>+        let requestStatusText = request.statusText;
>+        statusText = requestStatusText;
>+      } catch (e) {
>+    }

Missing a '}'.
Attached patch without letSplinter Review
Attachment #463327 - Attachment is obsolete: true
Attachment #463526 - Flags: review+
Attachment #463526 - Flags: approval2.0?
Comment on attachment 463526 [details] [diff] [review]
without let

a=beltzner, zero risk
Attachment #463526 - Flags: approval2.0? → approval2.0+
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/de4b86b6c74d
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 4.0b12
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.