diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs index bee9947a6b..66ac3e6908 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/SwitchBuilder.cs @@ -40,6 +40,7 @@ public sealed class SwitchBuilder foreach (ExecutorBinding executor in executors) { + // Explicit name: null element inside the collection argument. Throw.IfNull(executor, $"{nameof(executors)}[{executorIndex++}]"); if (!this._executorIndicies.TryGetValue(executor.Id, out int index)) @@ -71,6 +72,7 @@ public sealed class SwitchBuilder foreach (ExecutorBinding executor in executors) { + // Explicit name: null element inside the collection argument. Throw.IfNull(executor, $"{nameof(executors)}[{executorIndex++}]"); if (!this._executorIndicies.TryGetValue(executor.Id, out int index))