Skip to content

Commit

Permalink
stream: fix error-path function call
Browse files Browse the repository at this point in the history
The `onFinish()` function takes a single argument. The two extra
arguments passed here are already in the function scope, and may result
in the error being mishandled.

PR-URL: #41433
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
  • Loading branch information
Trott authored and targos committed Jan 14, 2022
1 parent 62aa190 commit b08138f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/streams/writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ function callFinal(stream, state) {
}
}
} catch (err) {
onFinish(stream, state, err);
onFinish(err);
}

state.sync = false;
Expand Down

0 comments on commit b08138f

Please sign in to comment.