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 <jasnell@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
pull/2125/merge
Sakthipriyan Vairamani 2015-07-14 01:08:25 +05:30
parent ac7d3fa0d9
commit 9afee6785e
1 changed files with 3 additions and 1 deletions

View File

@ -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();
}