From 41099cc5007801b5eb38b694e414a076a259d8d9 Mon Sep 17 00:00:00 2001 From: dnqbob Date: Tue, 21 May 2024 23:07:50 +0800 Subject: [PATCH] Fix a null check on HasParent --- OpenRA.Mods.Common/Traits/Parent/HasParent.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Parent/HasParent.cs b/OpenRA.Mods.Common/Traits/Parent/HasParent.cs index 01128314e3e9..bb8b5edb49a5 100644 --- a/OpenRA.Mods.Common/Traits/Parent/HasParent.cs +++ b/OpenRA.Mods.Common/Traits/Parent/HasParent.cs @@ -32,7 +32,8 @@ public HasParent(ActorInitializer init) void ITransformActorInitModifier.ModifyTransformActorInit(Actor self, TypeDictionary init) { - init.Add(new ParentActorInit(Parent)); + if (Parent != null) + init.Add(new ParentActorInit(Parent)); } } }