Complete activity if items count is 0 (#4623)

This commit is contained in:
Borja Fernández 2023-11-15 21:00:34 +01:00 committed by GitHub
parent 793002ac9f
commit 7fe05f491d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,6 +43,12 @@ public class ParallelForEach<T> : Activity
var tags = new List<Guid>();
var currentIndex = 0;
if (items.Count == 0)
{
await context.CompleteActivityAsync();
return;
}
foreach (var item in items)
{
// For each item, declare a new variable for the work to be scheduled.