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 danielleadams committed Feb 1, 2022
1 parent 2586f09 commit ae30b39
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 @@ -710,7 +710,7 @@ function callFinal(stream, state) {
}
}
} catch (err) {
onFinish(stream, state, err);
onFinish(err);
}

state.sync = false;
Expand Down

0 comments on commit ae30b39

Please sign in to comment.