stream: fix error-path function call

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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Rich Trott authored and Danielle Adams committed 2022-01-31 23:54:55 -05:00
1 parent 2586f098ac
commit ae30b391c2
1 file changed
+1 -1
+1 -1
View File
@@ -710,7 +710,7 @@ function callFinal(stream, state) {
}
}
} catch (err) {
onFinish(stream, state, err);
onFinish(err);
}
state.sync = false;