[NUI] Fix svace issues
authorzhouleonlei <zhouleon.lei@samsung.com>
Thu, 13 Jan 2022 03:04:42 +0000 (11:04 +0800)
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/Extension/LottieButtonExtension.cs
src/Tizen.NUI/src/internal/Layouting/RelativeLayout.cs [changed mode: 0644->0755]
src/Tizen.NUI/src/public/Common/Container.cs
src/Tizen.NUI/src/public/Layouting/FlexLayout.cs
src/Tizen.NUI/src/public/Layouting/GridLayout.cs

index cdb194b..d173d26 100755 (executable)
@@ -79,7 +79,7 @@ namespace Tizen.NUI.Components.Extension
         internal static void UpdateLottieView(Button button, ControlState previousState, LottieAnimationView lottieView)
         {
             var lottieStyle = ((ILottieButtonStyle)button.Style);
-            if (lottieStyle.PlayRange != null && lottieStyle.PlayRange.GetValue(button.ControlState, out var result))
+            if (lottieStyle != null && lottieStyle.PlayRange != null && lottieStyle.PlayRange.GetValue(button.ControlState, out var result))
             {
                 result.Show(lottieView, !previousState.Contains(ControlState.Pressed));
             }
old mode 100644 (file)
new mode 100755 (executable)
index 4f734c3..52c9a95
@@ -145,7 +145,7 @@ namespace Tizen.NUI
             Relative cacheTo;
             float RelativeOffsetFrom = propertyGetters.GetRelativeOffsetFrom(view);
             float RelativeOffsetTo = propertyGetters.GetRelativeOffsetTo(view);
-            float viewSize = propertyGetters.GetMeasuredSize(view.Layout);
+            float viewSize = view.Layout != null ? propertyGetters.GetMeasuredSize(view.Layout) : 0;
 
             if (propertyGetters.GetTargetFrom(view) is View targetFrom && targetFrom != Owner)
             {
index 2554cfd..6652914 100755 (executable)
@@ -107,7 +107,7 @@ namespace Tizen.NUI
             }
 
             var xNameToElementsOfOther = nameScopeOfOther?.NameToElement;
-            var xNameToElements = nameScope.NameToElement;
+            var xNameToElements = nameScope?.NameToElement;
 
             if (null != xNameToElements)
             {
index 3070fb4..fec7233 100755 (executable)
@@ -670,7 +670,7 @@ namespace Tizen.NUI
                                     new LayoutLength(Padding.Top + Padding.Bottom),
                                     new LayoutLength(child.HeightSpecification));
 
-            childLayout.Measure(childWidthMeasureSpec, childHeightMeasureSpec);
+            childLayout?.Measure(childWidthMeasureSpec, childHeightMeasureSpec);
 
             measureSize.width = childLayout.MeasuredWidth.Size.AsRoundedValue();
             measureSize.height = childLayout.MeasuredHeight.Size.AsRoundedValue();
index a8f0949..48c4a3c 100755 (executable)
@@ -358,7 +358,7 @@ namespace Tizen.NUI
         /// <since_tizen> 6 </since_tizen>
         protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
         {
-            int widthSize;
+            int widthSize = 0;
             int heightSize;
             var widthMode = widthMeasureSpec.Mode;
             var heightMode = heightMeasureSpec.Mode;
@@ -366,9 +366,16 @@ namespace Tizen.NUI
             InitChildren(widthMeasureSpec, heightMeasureSpec);
 
             if (widthMode == MeasureSpecification.ModeType.Exactly)
+            {
                 widthSize = (int)widthMeasureSpec.Size.AsRoundedValue();
+            }
             else
-                widthSize = (int)(hLocations[maxColumnConut] - hLocations[0] - columnSpacing);
+            {
+                if (hLocations.Length > maxColumnConut)
+                {
+                    widthSize = (int)(hLocations[maxColumnConut] - hLocations[0] - columnSpacing);
+                }
+            }
 
             if (heightMode == MeasureSpecification.ModeType.Exactly)
                 heightSize = (int)heightMeasureSpec.Size.AsRoundedValue();