From 8d4a43b2c259b81361d3d3aca16ea3b61b59283b Mon Sep 17 00:00:00 2001 From: John Lambert Date: Fri, 11 Oct 2024 10:20:01 -0400 Subject: [PATCH] If there are no enumerators, it enters an infinite loop. --- src/SIL.Machine/Utils/EnumerableExtensions.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SIL.Machine/Utils/EnumerableExtensions.cs b/src/SIL.Machine/Utils/EnumerableExtensions.cs index 1c2fc72b0..8bab692e2 100644 --- a/src/SIL.Machine/Utils/EnumerableExtensions.cs +++ b/src/SIL.Machine/Utils/EnumerableExtensions.cs @@ -13,6 +13,8 @@ Func, TResult> selector { // ToList is necessary to avoid deferred execution List> enumerators = source.Select(seq => seq.GetEnumerator()).ToList(); + if (enumerators.Count == 0) + yield break; try { while (true)