fix: HierarchyObject not throwing any error when trying to set itself as parent

This commit is contained in:
Syntriax 2025-04-06 10:57:22 +03:00
parent 33a452a62e
commit 901585d4bb

View File

@ -70,7 +70,10 @@ public class HierarchyObject : BaseEntity, IHierarchyObject
public void SetParent(IHierarchyObject? parent)
{
if (parent == this || Parent == parent)
if (parent == this)
throw new Exceptions.AssignException($"{Name} can not parent itself");
if (Parent == parent)
return;
IHierarchyObject? previousParent = Parent;