From cd90c70cdfce18f4211005599752eb37f86b4be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 11 Jul 2021 15:54:06 +0200 Subject: [PATCH] Fix a null reference exception. --- .../Widgets/Logic/Ingame/AddFactionSuffixLogic.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddFactionSuffixLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddFactionSuffixLogic.cs index 2c9f1698e7..b2531490fd 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddFactionSuffixLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/AddFactionSuffixLogic.cs @@ -19,6 +19,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic [ObjectCreator.UseCtor] public AddFactionSuffixLogic(Widget widget, World world) { + if (world.LocalPlayer == null) + return; + if (!ChromeMetrics.TryGet("FactionSuffix-" + world.LocalPlayer.Faction.InternalName, out string faction)) faction = world.LocalPlayer.Faction.InternalName; var suffix = "-" + faction;