Skip to content

Commit 6b9ad7c

Browse files
authored
fix out of index (Azure#53088)
1 parent 5fe6c99 commit 6b9ad7c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Visitors/FlattenPropertyVisitor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ private ValueExpression[] BuildConstructorParameters(CSharpType propertyType, Li
181181
{
182182
// If the additionalProperties parameter exists, we need to pass a new instance for it.
183183
parameters.Add(New.Instance(new CSharpType(typeof(Dictionary<string, BinaryData>))));
184+
185+
// If the additionalProperties parameter is the last parameter, we can break the loop.
186+
if (additionalPropertyIndex == fullConstructorParameters.Count - 1)
187+
{
188+
break;
189+
}
184190
fullConstructorParameterIndex++;
185191
}
186192
var (isOverriddenValueType, flattenedProperty) = flattenedProperties[i];

0 commit comments

Comments
 (0)