diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs index c30f475fbe..c089793293 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs @@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var pp = p; var client = world.LobbyInfo.ClientWithIndex(pp.ClientIndex); var item = playerTemplate.Clone(); - LobbyUtils.SetupClientWidget(item, client, orderManager, client.Bot == null); + LobbyUtils.SetupClientWidget(item, client, orderManager, client != null && client.Bot == null); var nameLabel = item.Get("NAME"); var nameFont = Game.Renderer.Fonts[nameLabel.Font]; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index 4e8fcb9833..f33f5f855f 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -240,7 +240,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { var adminIndicator = parent.GetOrNull("ADMIN_INDICATOR"); if (adminIndicator != null) - adminIndicator.IsVisible = () => c.IsAdmin; + adminIndicator.IsVisible = () => c != null && c.IsAdmin; var block = parent.GetOrNull("LATENCY"); if (block != null) @@ -253,8 +253,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic } var tooltip = parent.Get("CLIENT_REGION"); - tooltip.IsVisible = () => visible; - tooltip.Bind(orderManager, c.Index); + tooltip.IsVisible = () => c != null && visible; + if (c != null) + tooltip.Bind(orderManager, c.Index); } public static void SetupEditableNameWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager)