[NUI] Add an exception when deleting a view that is not child
authorhuiyu.eun <huiyu.eun@samsung.com>
Mon, 21 Dec 2020 02:19:34 +0000 (11:19 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 21 Dec 2020 12:05:23 +0000 (21:05 +0900)
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs

index 1d6bd79..4541357 100755 (executable)
@@ -165,6 +165,11 @@ namespace Tizen.NUI.BaseComponents
             if (child == null || child.GetParent() == null) // Early out if child null.
                 return;
 
+            if (child.Parent != this)
+            {
+                throw new System.InvalidOperationException("You have deleted a view that is not a child of this view.");
+            }
+
             bool hasLayout = (layout != null);
 
             // If View has a layout then do a deferred child removal