зеркало из https://github.com/Azure/autorest.git
Fix: Cannot read property 'pass-thru' of undefined crash (#3984)
* Fix for #3908 Validate that value is available before reading configuration. Offending plugin in my case with `imodeler1` * Add changes * Fix build error * Apply suggestions from code review Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com> * Update pipeline.ts Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>
This commit is contained in:
Родитель
5a47e7dbc2
Коммит
25cbf0fc97
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"packageName": "@autorest/core",
|
||||||
|
"comment": "**Fix** Cannot read property 'pass-thru' of undefined crash",
|
||||||
|
"type": "patch"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"packageName": "@autorest/core",
|
||||||
|
"email": "kant2002@gmail.com"
|
||||||
|
}
|
|
@ -359,12 +359,12 @@ export async function runPipeline(configView: AutorestContext, fileSystem: IFile
|
||||||
|
|
||||||
// you can have --pass-thru:FOO on the command line
|
// you can have --pass-thru:FOO on the command line
|
||||||
// or add pass-thru: true in a pipline configuration step.
|
// or add pass-thru: true in a pipline configuration step.
|
||||||
|
const configEntry = context.GetEntry(node.configScope.last.toString());
|
||||||
const passthru =
|
const passthru =
|
||||||
context.GetEntry(node.configScope.last.toString())["pass-thru"] === true ||
|
configEntry?.["pass-thru"] === true ||
|
||||||
values(configView.GetEntry("pass-thru")).any((each) => each === pluginName);
|
values(configView.GetEntry("pass-thru")).any((each) => each === pluginName);
|
||||||
const usenull =
|
const usenull =
|
||||||
context.GetEntry(node.configScope.last.toString())["null"] === true ||
|
configEntry?.["null"] === true || values(configView.GetEntry("null")).any((each) => each === pluginName);
|
||||||
values(configView.GetEntry("null")).any((each) => each === pluginName);
|
|
||||||
|
|
||||||
const plugin = usenull ? plugins.null : passthru ? plugins.identity : plugins[pluginName];
|
const plugin = usenull ? plugins.null : passthru ? plugins.identity : plugins[pluginName];
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче