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 <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 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
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.