[NUI] Fix svace issues. (#1867)
authorguowei.wang <guowei.wang@samsung.com>
Wed, 29 Jul 2020 05:44:02 +0000 (13:44 +0800)
committerGitHub <noreply@github.com>
Wed, 29 Jul 2020 05:44:02 +0000 (13:44 +0800)
src/Tizen.NUI/src/internal/Xaml/CreateValuesVisitor.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/XamlBinding/Page.cs

index 150b200..9a2106c 100755 (executable)
@@ -47,6 +47,8 @@ namespace Tizen.NUI.Xaml
             XamlParseException xpe;
             var type = XamlParser.GetElementType(node.XmlType, node, Context.RootElement?.GetType().GetTypeInfo().Assembly,
                 out xpe);
+            if (type == null)
+                throw new ArgumentNullException(nameof(type));
             if (xpe != null)
                 throw xpe;
 
index 3f80c68..b27d7f3 100755 (executable)
@@ -2116,8 +2116,11 @@ namespace Tizen.NUI.BaseComponents
                     value.Owner.Layout = new AbsoluteLayout();
 
                     // Copy Margin and Padding to replacement LayoutGroup.
-                    value.Owner.Layout.Margin = value.Margin;
-                    value.Owner.Layout.Padding = value.Padding;
+                    if (value.Owner.Layout != null) 
+                    {
+                        value.Owner.Layout.Margin = value.Margin;
+                        value.Owner.Layout.Padding = value.Padding;
+                    }
                 }
 
                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
index 04f965d..0682ed7 100755 (executable)
@@ -395,8 +395,11 @@ namespace Tizen.NUI
             {
                 if (args.Action != NotifyCollectionChangedAction.Add)
                     return;
-                foreach (IElement item in args.NewItems)
-                    item.Parent = this;
+                if (args.NewItems != null)
+                {
+                    foreach (IElement item in args.NewItems)
+                        item.Parent = this;
+                }
             }
         }