diff --git a/Projects/Server/Collections/PooledRefList.cs b/Projects/Server/Collections/PooledRefList.cs index dfde0358f..27eba2be1 100644 --- a/Projects/Server/Collections/PooledRefList.cs +++ b/Projects/Server/Collections/PooledRefList.cs @@ -1143,7 +1143,7 @@ public ref struct PooledRefList { var array = _items; - if (array.Length > 0) + if (array?.Length > 0) { Clear(); ArrayPool.Return(_items); diff --git a/Projects/Server/Collections/PooledRefQueue.cs b/Projects/Server/Collections/PooledRefQueue.cs index 7d9d54de4..cef14806a 100644 --- a/Projects/Server/Collections/PooledRefQueue.cs +++ b/Projects/Server/Collections/PooledRefQueue.cs @@ -385,7 +385,7 @@ public ref struct PooledRefQueue public void Dispose() { var array = _array; - if (array.Length > 0) + if (array?.Length > 0) { Clear(); (_mt ? ArrayPool.Shared : STArrayPool.Shared).Return(array);