diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index 9970f1339a..fb33763952 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -492,7 +492,11 @@ namespace OpenRA.Server break; } - var pingFromClient = LobbyInfo.PingFromClient(GetClient(conn)); + var client = GetClient(conn); + if (client == null) + return; + + var pingFromClient = LobbyInfo.PingFromClient(client); if (pingFromClient == null) return; diff --git a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs index 525867e271..2a1c2304e1 100644 --- a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs @@ -186,8 +186,11 @@ namespace OpenRA.Mods.Common.Server server.LobbyInfo.Clients.Remove(occupant); server.SyncLobbyClients(); var ping = server.LobbyInfo.PingFromClient(occupant); - server.LobbyInfo.ClientPings.Remove(ping); - server.SyncClientPing(); + if (ping != null) + { + server.LobbyInfo.ClientPings.Remove(ping); + server.SyncClientPing(); + } } else { @@ -221,7 +224,11 @@ namespace OpenRA.Mods.Common.Server { server.LobbyInfo.Clients.Remove(occupant); var ping = server.LobbyInfo.PingFromClient(occupant); - server.LobbyInfo.ClientPings.Remove(ping); + if (ping != null) + { + server.LobbyInfo.ClientPings.Remove(ping); + server.SyncClientPing(); + } } server.SyncLobbyClients();