fix: Fixes PooledRefList ToList returning wrong size (#1899)

### Summary

- Fixed a bug caused by a bad assumption. If `m_List[index]` is sparse and null values are casted, the server does not crash.
- Fixed a bug where `PooledRefList.ToList` extension method returned the wrong list size.
This commit is contained in:
Kamron Batman 2024-08-05 08:50:56 -07:00 committed by GitHub
parent a6a647551f
commit 5d9d1a2118
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -1274,7 +1274,10 @@ namespace Server.Gumps
i < 9 && index >= 0 && index < m_List.Count;
++i, ++index)
{
var a = (Account)m_List[index];
if (m_List[index] is not Account a)
{
continue;
}
var offset = 200 + i * 20;