[NUI] Fix null reference check in CollectionViews. (#2942)
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Wed, 21 Apr 2021 06:18:59 +0000 (15:18 +0900)
committerJoogabYun <40262755+JoogabYun@users.noreply.github.com>
Thu, 22 Apr 2021 04:10:45 +0000 (13:10 +0900)
src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/LinearLayouter.cs

index 51105ec..961f19a 100755 (executable)
@@ -718,7 +718,8 @@ namespace Tizen.NUI.Components
                 string styleName = "Tizen.NUI.Compoenents." + (itemsLayouter is LinearLayouter? "LinearLayouter" : (itemsLayouter is GridLayouter ? "GridLayouter" : "ItemsLayouter"));
                 using (ViewStyle layouterStyle = ThemeManager.GetStyle(styleName))
                 {
-                    itemsLayouter.Padding = new Extents(layouterStyle.Padding);
+                    if (layouterStyle != null)
+                        itemsLayouter.Padding = new Extents(layouterStyle.Padding);
                 }
             }
         }
index cf651a2..f639753 100755 (executable)
@@ -642,6 +642,11 @@ namespace Tizen.NUI.Components
             else if (isGrouped)
             {
                 GroupInfo gInfo = GetGroupInfo(index);
+                if (gInfo == null)
+                {
+                    Tizen.Log.Error("NUI", "GroupInfo failed to get in GetItemPosition()!");
+                    return (0, 0);
+                }
                 float current = GetGroupPosition(gInfo, index);
                 Extents itemMargin = CandidateMargin;