Skip to content

Commit

Permalink
fix transform stall on teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Oct 30, 2023
1 parent 88f392b commit d2d01a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,14 @@ class Transform extends Duplex {
}
}

destroy (err) {
super.destroy(err)
if (this._transformState.data !== null) {
this._transformState.data = null
this._transformState.afterTransform()
}
}

_transform (data, cb) {
cb(null, data)
}
Expand Down

0 comments on commit d2d01a5

Please sign in to comment.