From 4b19bd28967101b7afed3819cf595d4f04a1b11e Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 2 Aug 2010 11:59:58 +0200 Subject: [PATCH] Client.onend: Anticipate that the HTTP parser object is uninitialized when the client setup failed. --- lib/http.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http.js b/lib/http.js index ff54503..8c9a850 100644 --- a/lib/http.js +++ b/lib/http.js @@ -916,7 +916,7 @@ function Client ( ) { }); self.onend = function () { - parser.finish(); + if (parser) parser.finish(); debug("self got end closing. readyState = " + self.readyState); self.end(); }; -- 2.7.4