From d76eacd4e618d60714f2dd568d45bd6cd96019b6 Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 26 Dec 2012 15:57:49 -0800 Subject: [PATCH] http: Handle end only when stream is not dumped This fixes regression introduced in some cases by 8bf0c15 --- lib/http.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/http.js b/lib/http.js index 5013f3c0a3..d8a22bb0bb 100644 --- a/lib/http.js +++ b/lib/http.js @@ -160,7 +160,9 @@ function parserOnMessageComplete() { stream._readableState.onread(null, null); } - if (!stream._readableState.endEmitted && !parser.incoming._pendings.length) { + if (stream && + !stream._readableState.endEmitted && + !parser.incoming._pendings.length) { // For emit end event stream._readableState.onread(null, null); }