Bug 836630 - Fix intermittent failures on try - when the http channel doesn't have an mResponseHead, we can't get the response status. r=ttaubert
authorTanvi Vyas <tvyas@mozilla.com>
Wed, 06 Feb 2013 11:00:36 -0800
changeset 130919 912893285503535fe3635b9fedc10bb95ff5e3d4
parent 130918 54a885e14465550dde7601ad5a26aa9c17f25cc2
child 130920 eba3447f6c3725b1925e92fa179776d2c8cacaad
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs836630
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 836630 - Fix intermittent failures on try - when the http channel doesn't have an mResponseHead, we can't get the response status. r=ttaubert
browser/base/content/browser-thumbnails.js
--- a/browser/base/content/browser-thumbnails.js
+++ b/browser/base/content/browser-thumbnails.js
@@ -154,18 +154,24 @@ let gBrowserThumbnails = {
 
     let httpChannel;
     try {
       httpChannel = channel.QueryInterface(Ci.nsIHttpChannel);
     } catch (e) { /* Not an HTTP channel. */ }
 
     if (httpChannel) {
       // Continue only if we have a 2xx status code.
-      if (Math.floor(httpChannel.responseStatus / 100) != 2)
+      try {
+        if (Math.floor(httpChannel.responseStatus / 100) != 2)
+          return false;
+      } catch (e) {
+        // Can't get response information from the httpChannel
+        // because mResponseHead is not available.
         return false;
+      }
 
       // Cache-Control: no-store.
       if (httpChannel.isNoStoreResponse())
         return false;
 
       // Don't capture HTTPS pages unless the user explicitly enabled it.
       if (uri.schemeIs("https") && !this._sslDiskCacheEnabled)
         return false;