Fix a null reference exception.

This commit is contained in:
Matthias Mailänder
2021-07-11 15:54:06 +02:00
committed by abcdefg30
parent f1f5df3749
commit cd90c70cdf

View File

@@ -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;