[NUI] Fix Svace defects for NUI and wearable
authorzhouleonlei <zhouleon.lei@samsung.com>
Mon, 22 Feb 2021 06:39:38 +0000 (14:39 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 25 Feb 2021 08:24:58 +0000 (17:24 +0900)
src/Tizen.NUI.Wearable/src/internal/FishEyeLayoutManager.cs
src/Tizen.NUI/src/internal/XamlBinding/SynchronizedList.cs

index c343d93..b677003 100755 (executable)
@@ -89,15 +89,21 @@ namespace Tizen.NUI.Wearable
             {
                 FocusedIndex = Math.Min(Container.Children.Count - 1, FocusedIndex + 1);
                 centerItem = Container.Children[FocusedIndex] as RecycleItem;
-                centerItem.Position = new Position(0.0f, Math.Abs(StepSize * (centerItem.DataIndex)));
-                centerItem.Scale = new Vector3(1.0f, 1.0f, 1.0f);
+                if (centerItem != null)
+                {
+                    centerItem.Position = new Position(0.0f, Math.Abs(StepSize * (centerItem.DataIndex)));
+                    centerItem.Scale = new Vector3(1.0f, 1.0f, 1.0f);
+                }
             }
             else if (StepSize != 0 && centerItemPosition >= stepRange.Y)
             {
                 FocusedIndex = Math.Max(0, FocusedIndex - 1);
                 centerItem = Container.Children[FocusedIndex] as RecycleItem;
-                centerItem.Position = new Position(0.0f, Math.Abs(StepSize * (centerItem.DataIndex)));
-                centerItem.Scale = new Vector3(1.0f, 1.0f, 1.0f);
+                if (centerItem != null)
+                {
+                    centerItem.Position = new Position(0.0f, Math.Abs(StepSize * (centerItem.DataIndex)));
+                    centerItem.Scale = new Vector3(1.0f, 1.0f, 1.0f);
+                }
             }
             else
             {
index 899e0ef..b001795 100755 (executable)
@@ -75,14 +75,14 @@ namespace Tizen.NUI.Binding
 
         public IEnumerator<T> GetEnumerator()
         {
-            ReadOnlyCollection<T> snap = _snapshot;
-            if (snap == null)
+            lock (_list)
             {
-                lock (_list)
-                    _snapshot = snap = new ReadOnlyCollection<T>(_list.ToList());
+                if (_snapshot == null)
+                {
+                    _snapshot = new ReadOnlyCollection<T>(_list.ToList());
+                }
+                return _snapshot.GetEnumerator();
             }
-
-            return snap?.GetEnumerator();
         }
 
         public int IndexOf(T item)