Skip to content

Commit

Permalink
streams: fix fd is null when calling clearBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
kylo5aby committed Dec 1, 2023
1 parent a3ee187 commit bc2a89b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/streams/writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,8 @@ function errorBuffer(state) {

// If there's something in the buffer waiting, then process it.
function clearBuffer(stream, state) {
if ((state[kState] & (kDestroyed | kBufferProcessing | kCorked | kBuffered)) !== kBuffered) {
if ((state[kState] & (kDestroyed | kBufferProcessing | kCorked | kBuffered)) !== kBuffered ||
(state[kState] & (kDestroyed | kBufferProcessing | kCorked | kConstructed)) !== kConstructed) {
return;
}

Expand Down

0 comments on commit bc2a89b

Please sign in to comment.