[NUI] check layout owner is null when removing childLayout (#1472)
authorneostom432 <31119276+neostom432@users.noreply.github.com>
Wed, 18 Mar 2020 04:03:29 +0000 (13:03 +0900)
committerGitHub <noreply@github.com>
Wed, 18 Mar 2020 04:03:29 +0000 (13:03 +0900)
If layout owner is null, cannot remove owner from it's parent.
Check owner is null.

src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs

index fdc6b200bdf5358d9a6d53c7743df2f3842b1fc1..45cd082e92374a83e2d375e5a961064815331df3 100755 (executable)
@@ -104,9 +104,12 @@ namespace Tizen.NUI
                     }
                     else
                     {
-                        Interop.Actor.Actor_Remove(View.getCPtr(childLayout.Owner.Parent), View.getCPtr(childLayout.Owner));
-                        if (NDalicPINVOKE.SWIGPendingException.Pending)
-                            throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                        if(childLayout.Owner != null)
+                        {
+                            Interop.Actor.Actor_Remove(View.getCPtr(childLayout.Owner.Parent), View.getCPtr(childLayout.Owner));
+                            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                        }
                     }
 
                     // Reset condition for animation ready for next transition when required.