check for null because clients may be gone already

fixes #3694
This commit is contained in:
Matthias Mailänder
2013-08-18 08:41:00 +02:00
parent 81f577dcbe
commit f5cf3df003

View File

@@ -58,7 +58,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
item.Get<LabelWidget>("FACTION").GetText = () => pp.Country.Name;
var team = item.Get<LabelWidget>("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);