fix: HierarchyObject not throwing any error when trying to set itself as parent
This commit is contained in:
parent
33a452a62e
commit
901585d4bb
@ -70,7 +70,10 @@ public class HierarchyObject : BaseEntity, IHierarchyObject
|
|||||||
|
|
||||||
public void SetParent(IHierarchyObject? parent)
|
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;
|
return;
|
||||||
|
|
||||||
IHierarchyObject? previousParent = Parent;
|
IHierarchyObject? previousParent = Parent;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user