From f5cf3df0039abd98d429eacdc19f701a53b1c50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 18 Aug 2013 08:41:00 +0200 Subject: [PATCH] check for null because clients may be gone already fixes #3694 --- OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs index 5888712a66..5cc61f5cc7 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs @@ -58,7 +58,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic item.Get("FACTION").GetText = () => pp.Country.Name; var team = item.Get("TEAM"); - var teamNumber = world.LobbyInfo.ClientWithIndex(pp.ClientIndex).Team; + var client = world.LobbyInfo.ClientWithIndex(pp.ClientIndex); + var teamNumber = (client == null) ? 0 : client.Team; team.GetText = () => (teamNumber == 0) ? "-" : teamNumber.ToString(); scrollpanel.AddChild(item);