Merge pull request #6450 from obrakmann/fix6444
Prevent a NullReferenceException in GameInfoStatsLogic
This commit is contained in:
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
var nameLabel = item.Get<LabelWidget>("NAME");
|
var nameLabel = item.Get<LabelWidget>("NAME");
|
||||||
nameLabel.GetText = () =>
|
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 + " (Gone)";
|
||||||
return pp.PlayerName + (pp.WinState == WinState.Undefined ? "" : " (" + pp.WinState + ")");
|
return pp.PlayerName + (pp.WinState == WinState.Undefined ? "" : " (" + pp.WinState + ")");
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
var client = player.World.LobbyInfo.ClientWithIndex(player.ClientIndex);
|
var client = player.World.LobbyInfo.ClientWithIndex(player.ClientIndex);
|
||||||
playerName.GetText = () =>
|
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 + " (Gone)";
|
||||||
return player.PlayerName + (player.WinState == WinState.Undefined ? "" : " (" + player.WinState + ")");
|
return player.PlayerName + (player.WinState == WinState.Undefined ? "" : " (" + player.WinState + ")");
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user