[NUI] Fix svace defects
authorzhouleonlei <zhouleon.lei@samsung.com>
Mon, 16 Aug 2021 06:27:31 +0000 (14:27 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 18 Aug 2021 03:10:44 +0000 (12:10 +0900)
src/Tizen.NUI.Components/Controls/Menu.cs
src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs
src/Tizen.NUI/src/internal/EXaml/Action/GetObjectByPropertyAction.cs
src/Tizen.NUI/src/internal/EXaml/Operation/SetBinding.cs
src/Tizen.NUI/src/internal/XamlBinding/WeakEventManager.cs

index 323ef32..beeab4f 100755 (executable)
@@ -474,7 +474,7 @@ namespace Tizen.NUI.Components
             while (parent)
             {
                 root = parent;
-                parent = parent.GetParent() as View;
+                parent = parent?.GetParent() as View;
             }
 
             return root;
index 89a36eb..e4d7f6d 100755 (executable)
@@ -971,7 +971,7 @@ namespace Tizen.NUI.Components
             if (item == null) return;
             if (item == Header)
             {
-                item.Hide();
+                item?.Hide();
                 return;
             }
             if (item == Footer)
index cd82b34..bd2343d 100755 (executable)
@@ -61,9 +61,9 @@ namespace Tizen.NUI.EXaml
 
         public void OnActive()
         {
-            if (null != childOp)
+            if (null != childOp && childOp.ValueList[0] is Instance valueList0)
             {
-                int instanceIndex = (childOp.ValueList[0] as Instance).Index;
+                int instanceIndex = valueList0.Index;
                 string propertyName = childOp.ValueList[1] as string;
                 globalDataList.Operations.Add(new GetObjectByProperty(globalDataList, instanceIndex, propertyName));
             }
index ea45641..246e64d 100755 (executable)
@@ -41,7 +41,10 @@ namespace Tizen.NUI.EXaml
             BindableObject bindableObject = globalDataList.GatheredInstances[instanceIndex] as BindableObject;
             var property = globalDataList.GatheredBindableProperties[bindablePropertyIndex];
             var value = globalDataList.GatheredInstances[valueIndex] as BindingBase;
-            bindableObject?.SetBinding(property, value);
+            if (value != null)
+            {
+                bindableObject?.SetBinding(property, value);
+            }
         }
 
         private int instanceIndex;
index 802e1d4..128a35d 100755 (executable)
@@ -95,7 +95,7 @@ namespace Tizen.NUI.Binding
 
             foreach (Tuple<object, MethodInfo> tuple in toRaise)
             {
-                tuple.Item2.Invoke(tuple.Item1, new[] { sender, args });
+                tuple.Item2?.Invoke(tuple.Item1, new[] { sender, args });
             }
         }