Skip to content

Commit

Permalink
http: Check this.connection before using it
Browse files Browse the repository at this point in the history
Refer: nodejs/node-v0.x-archive#25670

PR-URL: #2172
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Brendan Ashworth <[email protected]>
  • Loading branch information
thefourtheye committed Jul 22, 2015
1 parent ac7d3fa commit 9afee67
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,9 @@ OutgoingMessage.prototype.end = function(data, encoding, callback) {
// There is the first message on the outgoing queue, and we've sent
// everything to the socket.
debug('outgoing message end.');
if (this.output.length === 0 && this.connection._httpMessage === this) {
if (this.output.length === 0 &&
this.connection &&
this.connection._httpMessage === this) {
this._finish();
}

Expand Down

0 comments on commit 9afee67

Please sign in to comment.