Skip to content

Commit

Permalink
only replace handle error handler if it didn't have an error
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Aug 14, 2020
1 parent ec3483b commit 97d8bd5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@ class ZlibBase extends Minipass {
// after each call, these handlers start piling up.
this[_handle].removeAllListeners('error')
// make sure OUR error listener is still attached tho
this[_handle].on('error', er => this[_onError](new ZlibError(er)))
}
}

if (this[_handle])
this[_handle].on('error', er => this[_onError](new ZlibError(er)))

let writeReturn
if (result) {
if (Array.isArray(result) && result.length > 0) {
Expand Down

0 comments on commit 97d8bd5

Please sign in to comment.