From 41e1b171ec644a1a5645e819cec7c8ccc0ba5f2e Mon Sep 17 00:00:00 2001 From: isaacs Date: Mon, 10 Sep 2012 15:58:30 -0700 Subject: [PATCH] stream.pipe: Don't call destroy() unless it's a function --- lib/stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stream.js b/lib/stream.js index 600416396f..c03b8b77de 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -71,7 +71,7 @@ Stream.prototype.pipe = function(dest, options) { if (didOnEnd) return; didOnEnd = true; - dest.destroy(); + if (typeof dest.destroy === 'function') dest.destroy(); } // don't leave dangling pipes when there are errors.