diff --git a/lib/stream.js b/lib/stream.js index 600416396f0..c03b8b77deb 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.