From 34cc79002c116249685f70a915151c41270b0a59 Mon Sep 17 00:00:00 2001
From: WeylonSantana <63019821+WeylonSantana@users.noreply.github.com>
Date: Mon, 14 Aug 2023 14:45:30 -0300
Subject: [PATCH] avoid description window to delete control twice (#1835)
---
.../DescriptionWindows/Components/ComponentBase.cs | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/Intersect.Client/Interface/Game/DescriptionWindows/Components/ComponentBase.cs b/Intersect.Client/Interface/Game/DescriptionWindows/Components/ComponentBase.cs
index 5cf1843b78..10aec3c518 100644
--- a/Intersect.Client/Interface/Game/DescriptionWindows/Components/ComponentBase.cs
+++ b/Intersect.Client/Interface/Game/DescriptionWindows/Components/ComponentBase.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Intersect.Client.Core;
using Intersect.Client.Framework.Gwen.Control;
@@ -86,7 +86,15 @@ protected virtual void GenerateComponents()
///
/// Dispose of the object.
///
- public virtual void Dispose() => mParent.RemoveChild(mContainer, true);
+ public virtual void Dispose()
+ {
+ if(!mParent.Children.Contains(mContainer))
+ {
+ return;
+ }
+
+ mParent.RemoveChild(mContainer, true);
+ }
///
/// Load the Json layout of the current component.