Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Oct 2, 2023
1 parent 2ea8885 commit dc1debf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/internal/streams/writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,13 @@ function Writable(options) {
destroyImpl.construct(this, () => {
const state = this._writableState;

if (!state.writing) {
if ((state.state & kWriting) === 0) {
clearBuffer(this, state);
}

finishMaybe(this, state);
if ((state.state & kEnding) !== 0) {
finishMaybe(this, state);
}
});
}

Expand Down

0 comments on commit dc1debf

Please sign in to comment.