Bug 1429365 - Prevent this.sink is undefined exception for resources loaded from bytecode cache. r=rickychien
MozReview-Commit-ID: C9VFVoK0pPG
--- 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