[NUI] Fix svace issue (#1172)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Mon, 9 Dec 2019 02:02:48 +0000 (11:02 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 9 Dec 2019 02:02:48 +0000 (11:02 +0900)
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI.Components/Controls/DropDown.cs

index 8bc7569..9305ba7 100755 (executable)
@@ -308,13 +308,13 @@ namespace Tizen.NUI.Components
 
             adapter.RemoveData(index);
 
-            if(index < dropDownMenuFullList.ChildCount)
+            if(index < dropDownMenuFullList?.ChildCount)
             {
-                View childToRemove = dropDownMenuFullList.GetChildAt((uint)index);
+                View childToRemove = dropDownMenuFullList?.GetChildAt((uint)index);
                 if (childToRemove)
                 {
                     childToRemove.TouchEvent -= ListItemTouchEvent;
-                    dropDownMenuFullList.Remove(childToRemove);
+                    dropDownMenuFullList?.Remove(childToRemove);
                     dropDownMenuFullList?.Layout?.RequestLayout();
                 }
             }
@@ -689,7 +689,10 @@ namespace Tizen.NUI.Components
                     data.IsSelected = false;
                 }
                 DropDownItemView listItemView = dropDownMenuFullList.GetChildAt((uint)selectedItemIndex) as DropDownItemView;
-                data.IsSelected = false;
+                if(data != null)
+                {
+                    data.IsSelected = false;
+                }
                 SetListItemToSelected(listItemView);
             }
 
@@ -835,8 +838,11 @@ namespace Tizen.NUI.Components
                     {
                         itemDataStyle.BackgroundColor = new Selector<Color>();
                     }
+                    if (null != itemDataStyle.BackgroundColor)
+                    {
+                        itemDataStyle.BackgroundColor.Clone(value);
+                    }
 
-                    itemDataStyle.BackgroundColor.Clone(value);
                 }
             }