Skip to content

Commit 1dfbfb5

Browse files
committed
fixup
1 parent 2ea8885 commit 1dfbfb5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/internal/streams/writable.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,13 @@ function Writable(options) {
397397
destroyImpl.construct(this, () => {
398398
const state = this._writableState;
399399

400-
if (!state.writing) {
400+
if ((state.state & kWriting) === 0) {
401401
clearBuffer(this, state);
402402
}
403403

404-
finishMaybe(this, state);
404+
if ((state.state & kEnding) !== 0) {
405+
finishMaybe(stream, state, true);
406+
}
405407
});
406408
}
407409

0 commit comments

Comments
 (0)