Fix a null reference exception.
This commit is contained in:
committed by
abcdefg30
parent
f1f5df3749
commit
cd90c70cdf
@@ -19,6 +19,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public AddFactionSuffixLogic(Widget widget, World world)
|
public AddFactionSuffixLogic(Widget widget, World world)
|
||||||
{
|
{
|
||||||
|
if (world.LocalPlayer == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!ChromeMetrics.TryGet("FactionSuffix-" + world.LocalPlayer.Faction.InternalName, out string faction))
|
if (!ChromeMetrics.TryGet("FactionSuffix-" + world.LocalPlayer.Faction.InternalName, out string faction))
|
||||||
faction = world.LocalPlayer.Faction.InternalName;
|
faction = world.LocalPlayer.Faction.InternalName;
|
||||||
var suffix = "-" + faction;
|
var suffix = "-" + faction;
|
||||||
|
|||||||
Reference in New Issue
Block a user