Skip to content

Commit

Permalink
Update lib/internal/streams/destroy.js
Browse files Browse the repository at this point in the history
Co-authored-by: Voltrex <[email protected]>
  • Loading branch information
ronag and VoltrexKeyva authored Nov 13, 2021
1 parent a35103f commit 24b4b5a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/internal/streams/destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ function _destroy(self, err, cb) {
const w = self._writableState;

if (!err) {
if (r?.autoDestroy && !isReadableFinished(self)) {
err = new AbortError();
} else if (w?.autoDestroy && !isWritableEnded(self)) {
if ((r?.autoDestroy && !isReadableFinished(self)) ||
(w?.autoDestroy && !isWritableEnded(self))) {
err = new AbortError();
}
}
Expand Down

0 comments on commit 24b4b5a

Please sign in to comment.