diff --git a/NonSucking.Framework.Extension/Collections/EnumerationmodifiableConcurrentList.cs b/NonSucking.Framework.Extension/Collections/EnumerationmodifiableConcurrentList.cs index fa275b5..015579a 100644 --- a/NonSucking.Framework.Extension/Collections/EnumerationmodifiableConcurrentList.cs +++ b/NonSucking.Framework.Extension/Collections/EnumerationmodifiableConcurrentList.cs @@ -264,11 +264,14 @@ public Enumerator Get() Enumerator item; using (var __ = scopeSemaphore.EnterExclusivScope()) { - item = pool.Pop(); - item.Reset(); - gottem.Add(item); + if (pool.Count > 0) + { + item = pool.Pop(); + item.Reset(); + gottem.Add(item); + return item; + } } - return item; } var e = new Enumerator(list);