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: nodejs#41433
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
  • Loading branch information
Trott authored and thedull committed Jan 18, 2022
1 parent 707698c commit 7def195
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/streams/writable.js
Expand Up @@ -712,7 +712,7 @@ function callFinal(stream, state) {
}
}
} catch (err) {
onFinish(stream, state, err);
onFinish(err);
}

state.sync = false;
Expand Down

0 comments on commit 7def195

Please sign in to comment.