[NUI] Fix warning by checking null argument in LayoutGroup
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 5 Apr 2022 09:05:07 +0000 (18:05 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Wed, 20 Apr 2022 08:38:08 +0000 (17:38 +0900)
Like other APIs in LayoutGroup, exception should occur if LayoutItem
argument "child" is null.

src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs

index 420d0f5..5c972ce 100755 (executable)
@@ -626,9 +626,15 @@ namespace Tizen.NUI
         /// <param name="child">The child to measure.</param>
         /// <param name="parentWidthMeasureSpec">The width requirements for this view.</param>
         /// <param name="parentHeightMeasureSpec">The height requirements for this view.</param>
+        /// <exception cref="ArgumentNullException"> Thrown when child is null. </exception>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected void MeasureChildWithoutPadding(LayoutItem child, MeasureSpecification parentWidthMeasureSpec, MeasureSpecification parentHeightMeasureSpec)
         {
+            if (null == child)
+            {
+                throw new ArgumentNullException(nameof(child));
+            }
+
             View childOwner = child.Owner;
 
             MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification(