Merge pull request #6450 from obrakmann/fix6444

Prevent a NullReferenceException in GameInfoStatsLogic
This commit is contained in:
Matthias Mailänder
2014-09-13 18:52:56 +02:00
2 changed files with 2 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var nameLabel = item.Get<LabelWidget>("NAME");
nameLabel.GetText = () =>
{
if (client.State == Network.Session.ClientState.Disconnected)
if (client != null && client.State == Network.Session.ClientState.Disconnected)
return pp.PlayerName + " (Gone)";
return pp.PlayerName + (pp.WinState == WinState.Undefined ? "" : " (" + pp.WinState + ")");
};

View File

@@ -457,7 +457,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var client = player.World.LobbyInfo.ClientWithIndex(player.ClientIndex);
playerName.GetText = () =>
{
if (client.State == Network.Session.ClientState.Disconnected)
if (client != null && client.State == Network.Session.ClientState.Disconnected)
return player.PlayerName + " (Gone)";
return player.PlayerName + (player.WinState == WinState.Undefined ? "" : " (" + player.WinState + ")");
};