Open bryanbcook opened 11 months ago
The fix for this was merged, can we cut a new release?
I still want to resolve this error, could be related with your change. Visible in vscode extension 0.0.4 (the current main branch)
System.ArgumentNullException: Value cannot be null. (Parameter 'key')
at System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].FindValue(String key)
at System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TryGetValue(String key, Int32& value)
at GitHub.DistributedTask.Pipelines.ContextData.DictionaryContextData.set_Item(String key, PipelineContextData value)
at AzureDevops.ReadTemplate(Context context, String filenameAndRef, Dictionary`2 cparameters, String schemaName)
at MyClass.ExpandCurrentPipeline(JSObject handle, String currentFileName)
Edit User error, the code needs to validate that the key/name of a sequence parameter is defined
Most of the parser works good with working files, but some error checks are missing
Can you provide a sample that caused the error?
It is clearly a yaml syntax error and not any regression, so I created a new release 3.11.9 (vscode ext 0.0.4)
parameters:
- parameters: val # <-- syntax error, causes a null exception and doesn't tell what is wrong, you could also just remove the `name` key
type: object
default:
- a
- b
steps:
- script: echo ${{ converttojson(parameters.val) }}
May be worth to check the error in a unit test, to not be a System.ArgumentNullException
or other Null exception
That's an easy test to write. I'll open a PR
Consider the following
Should report an error message
A value for the 'required' parameter must be provided
No error message is reported