[NUI] fix non-initialized exception on layout notifier
authorEverLEEst(SangHyeon Lee) <sh10233.lee@samsung.com>
Wed, 12 Jan 2022 11:35:51 +0000 (20:35 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 19 Jan 2022 05:29:33 +0000 (14:29 +0900)
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/GridLayouter.cs
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/ItemsLayouter.cs
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/LinearLayouter.cs

index b44d0a3..453c574 100755 (executable)
@@ -502,6 +502,7 @@ namespace Tizen.NUI.Components
         {
             // Insert Single item.
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
             if (isSourceEmpty)
             {
                 Initialize(colView);
@@ -653,6 +654,7 @@ namespace Tizen.NUI.Components
         {
              // Insert Group
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
             if (isSourceEmpty)
             {
                 Initialize(colView);
@@ -798,6 +800,7 @@ namespace Tizen.NUI.Components
         {
             // Remove Single
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
 
             // Will be null if not a group.
             float currentSize = 0;
@@ -931,6 +934,7 @@ namespace Tizen.NUI.Components
         {
             // Remove Group
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -1031,6 +1035,7 @@ namespace Tizen.NUI.Components
         {
             // Reorder Single
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -1096,6 +1101,7 @@ namespace Tizen.NUI.Components
         {
             // Reorder Groups
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
index b40da89..bf16e6a 100755 (executable)
@@ -205,7 +205,10 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public virtual void NotifyDataSetChanged()
         {
-            Initialize(ItemsView);
+            if (ItemsView != null)
+            {
+                Initialize(ItemsView);
+            }
         }
 
         /// <summary>
index 3bf3282..6132778 100755 (executable)
@@ -515,6 +515,7 @@ namespace Tizen.NUI.Components
         {
             if (item == null)
                 throw new ArgumentNullException(nameof(item));
+            if (colView == null) return;
 
             if (!IsInitialized ||
                 (colView.SizingStrategy == ItemSizingStrategy.MeasureFirst &&
@@ -553,6 +554,7 @@ namespace Tizen.NUI.Components
         {
             // Insert Single item.
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
 
             if (isSourceEmpty)
             {
@@ -708,6 +710,7 @@ namespace Tizen.NUI.Components
         {
              // Insert Group
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
 
             if (isSourceEmpty)
             {
@@ -865,6 +868,7 @@ namespace Tizen.NUI.Components
         {
             // Remove Single
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -993,6 +997,7 @@ namespace Tizen.NUI.Components
         {
             // Remove Group
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -1101,6 +1106,7 @@ namespace Tizen.NUI.Components
         {
             // Reorder Single
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -1174,6 +1180,7 @@ namespace Tizen.NUI.Components
         {
             // Reorder Groups
             if (source == null) throw new ArgumentNullException(nameof(source));
+            if (colView == null) return;
 
             // Will be null if not a group.
             float currentSize = StepCandidate;
@@ -1289,6 +1296,7 @@ namespace Tizen.NUI.Components
             if (source == null) throw new ArgumentNullException(nameof(source));
             IGroupableItemSource gSource = source as IGroupableItemSource;
             if (gSource == null)throw new Exception("Source is not group!");
+            if (colView == null) return;
 
             // Get the first Visible Position to adjust.
             /*