Skip to content

Commit

Permalink
If there are no enumerators, it enters an infinite loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Oct 11, 2024
1 parent 3616630 commit 8d4a43b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SIL.Machine/Utils/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Func<IEnumerable<TSource>, TResult> selector
{
// ToList is necessary to avoid deferred execution
List<IEnumerator<TSource>> enumerators = source.Select(seq => seq.GetEnumerator()).ToList();
if (enumerators.Count == 0)
yield break;
try
{
while (true)
Expand Down

0 comments on commit 8d4a43b

Please sign in to comment.