Bug 1429365 - Prevent this.sink is undefined exception for resources loaded from bytecode cache. r=rickychien
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 15 Jan 2018 07:23:08 -0800
changeset 453662 ffe766bd6f33fe2104ad27879cd6b4d8a7a23c57
parent 453661 1c020ef5743f16883050c5c5b78c13c65828f64f
child 453680 68c68173378867d3a4b11c5a6bad6270a556d2de
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrickychien
bugs1429365
milestone59.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 1429365 - Prevent this.sink is undefined exception for resources loaded from bytecode cache. r=rickychien MozReview-Commit-ID: C9VFVoK0pPG
devtools/shared/webconsole/network-monitor.js
--- a/devtools/shared/webconsole/network-monitor.js
+++ b/devtools/shared/webconsole/network-monitor.js
@@ -518,16 +518,21 @@ NetworkResponseListener.prototype = {
 
   /**
    * Handle the onStopRequest by closing the sink output stream.
    *
    * For more documentation about nsIRequestObserver go to:
    * https://developer.mozilla.org/En/NsIRequestObserver
    */
   onStopRequest: function () {
+    // Bug 1429365: onStopRequest may be called after onComplete for resources loaded
+    // from bytecode cache.
+    if (!this.httpActivity) {
+      return;
+    }
     this._findOpenResponse();
     this.sink.outputStream.close();
   },
 
   // nsIProgressEventSink implementation
 
   /**
    * Handle progress event as data is transferred.  This is used to record the