[NUI] Fix to call base.Initialize() of LinearLayouter and GridLayouter (#3338)
authorJaehyun Cho <jaehyun0cho@gmail.com>
Thu, 22 Jul 2021 02:06:08 +0000 (11:06 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 26 Jul 2021 09:00:32 +0000 (18:00 +0900)
Previously, base.Initialize() of LinearLayouter and GridLayouter was not
called if source was empty.
This caused Container to be null and caused null reference in
RequestLayout().

Now, it is guaranteed that base.Initialize() of LinearLayouter and
GridLayouter is called.

Co-authored-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/GridLayouter.cs
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/LinearLayouter.cs

index b88971c..f5905f2 100755 (executable)
@@ -118,6 +118,7 @@ namespace Tizen.NUI.Components
             if (pureCount == 0)
             {
                 isSourceEmpty = true;
+                base.Initialize(colView);
                 return;
             }
             isSourceEmpty = false;
index a6a6ffb..6159937 100755 (executable)
@@ -113,6 +113,7 @@ namespace Tizen.NUI.Components
             if (count == (hasHeader? (hasFooter? 2 : 1) : 0))
             {
                 isSourceEmpty = true;
+                base.Initialize(view);
                 return;
             }
             isSourceEmpty = false;