Added null-check for list of clients

This commit is contained in:
MaxXor 2015-08-28 12:16:55 +02:00
parent 69481ed813
commit e9fdb1a431
1 changed files with 10 additions and 7 deletions

View File

@ -400,15 +400,18 @@ namespace xServer.Core.Networking
lock (_clientsLock)
{
while (_clients.Count != 0)
if (_clients != null)
{
try
{
_clients[0].Disconnect();
_clients.RemoveAt(0);
}
catch
while (_clients.Count != 0)
{
try
{
_clients[0].Disconnect();
_clients.RemoveAt(0);
}
catch
{
}
}
}
}