Bug 1429365 - Prevent this.sink is undefined exception for resources loaded from bytecode cache. r=rickychien draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 15 Jan 2018 07:23:08 -0800
changeset 720414 a9f8ab1553bf838df3bfdf2e4c5a702d7c15b15a
parent 720380 b7d66e4e60ef177ec9ae687daa29443ae4a2acfc
child 746065 97c3b28839d384bc3a6cc14eb14ac2ba37c4b6db
push id95544
push userbmo:poirot.alex@gmail.com
push dateMon, 15 Jan 2018 15:38:06 +0000
reviewersrickychien
bugs1429365
milestone59.0a1
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