From 9afee6785e3f0710172a423eb6140e29bf436475 Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Tue, 14 Jul 2015 01:08:25 +0530 Subject: [PATCH] http: Check this.connection before using it Refer: https://github.com/joyent/node/pull/25670 PR-URL: https://github.com/nodejs/io.js/pull/2172 Reviewed-By: James M Snell Reviewed-By: Brendan Ashworth --- lib/_http_outgoing.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 6aad552e7a5..c9b0a87b3db 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -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(); }