Skip to content

Commit 41e1b17

Browse files
committed
stream.pipe: Don't call destroy() unless it's a function
1 parent 54a4c63 commit 41e1b17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/stream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Stream.prototype.pipe = function(dest, options) {
7171
if (didOnEnd) return;
7272
didOnEnd = true;
7373

74-
dest.destroy();
74+
if (typeof dest.destroy === 'function') dest.destroy();
7575
}
7676

7777
// don't leave dangling pipes when there are errors.

0 commit comments

Comments
 (0)