[NUI] Fix failed in TCT
authorFang Xiaohui <xiaohui.fang@samsung.com>
Thu, 2 Dec 2021 02:47:09 +0000 (10:47 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 8 Dec 2021 08:43:35 +0000 (17:43 +0900)
src/Tizen.NUI.Components/Controls/Button.cs
src/Tizen.NUI.Components/Controls/ButtonBindableProperty.cs

index d6e8305..07eb119 100755 (executable)
@@ -607,7 +607,7 @@ namespace Tizen.NUI.Components
         }
         private StringSelector InternalTextSelector
         {
-            get => buttonText == null ? null : new StringSelector(buttonText.TextSelector);
+            get => buttonText?.TextSelector == null ? null : new StringSelector(buttonText.TextSelector);
             set
             {
                 if (value == null || buttonText == null)
@@ -641,7 +641,7 @@ namespace Tizen.NUI.Components
         }
         private StringSelector InternalTranslatableTextSelector
         {
-            get => buttonText == null ? null : new StringSelector(buttonText.TranslatableTextSelector);
+            get => (buttonText?.TranslatableTextSelector == null) ? null : new StringSelector(buttonText.TranslatableTextSelector);
             set
             {
                 if (value == null || buttonText == null)
@@ -675,7 +675,7 @@ namespace Tizen.NUI.Components
         }
         private ColorSelector InternalTextColorSelector
         {
-            get => buttonText == null ? null : new ColorSelector(buttonText.TextColorSelector);
+            get => buttonText?.TextColorSelector == null ? null : new ColorSelector(buttonText.TextColorSelector);
             set
             {
                 if (value == null || buttonText == null)
@@ -709,7 +709,7 @@ namespace Tizen.NUI.Components
         }
         private FloatSelector InternalPointSizeSelector
         {
-            get => buttonText == null ? null : new FloatSelector(buttonText.PointSizeSelector);
+            get => buttonText?.PointSizeSelector == null ? null : new FloatSelector(buttonText.PointSizeSelector);
             set
             {
                 if (value == null || buttonText == null)
@@ -743,7 +743,7 @@ namespace Tizen.NUI.Components
         }
         private StringSelector InternalIconURLSelector
         {
-            get => buttonIcon == null ? null : new StringSelector(buttonIcon.ResourceUrlSelector);
+            get => buttonIcon?.ResourceUrlSelector == null ? null : new StringSelector(buttonIcon.ResourceUrlSelector);
             set
             {
                 if (value == null || buttonIcon == null)
index 9c35857..b1f5832 100755 (executable)
@@ -156,10 +156,7 @@ namespace Tizen.NUI.Components
         public static readonly BindableProperty TextSelectorProperty = BindableProperty.Create(nameof(TextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
-            if (newValue != null)
-            {
-                instance.InternalTextSelector = newValue as StringSelector;
-            }
+            instance.InternalTextSelector = newValue as StringSelector;
         },
         defaultValueCreator: (bindable) =>
         {
@@ -174,10 +171,7 @@ namespace Tizen.NUI.Components
         public static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create(nameof(TranslatableTextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
-            if (newValue != null)
-            {
-                instance.InternalTranslatableTextSelector = newValue as StringSelector;
-            }
+            instance.InternalTranslatableTextSelector = newValue as StringSelector;
         },
         defaultValueCreator: (bindable) =>
         {
@@ -192,10 +186,7 @@ namespace Tizen.NUI.Components
         public static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create(nameof(TextColorSelector), typeof(ColorSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
-            if (newValue != null)
-            {
-                instance.InternalTextColorSelector = newValue as ColorSelector;
-            }
+            instance.InternalTextColorSelector = newValue as ColorSelector;
         },
         defaultValueCreator: (bindable) =>
         {
@@ -210,10 +201,7 @@ namespace Tizen.NUI.Components
         public static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create(nameof(PointSizeSelector), typeof(FloatSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
-            if (newValue != null)
-            {
-                instance.InternalPointSizeSelector = newValue as FloatSelector;
-            }
+            instance.InternalPointSizeSelector = newValue as FloatSelector;
         },
         defaultValueCreator: (bindable) =>
         {
@@ -228,10 +216,7 @@ namespace Tizen.NUI.Components
         public static readonly BindableProperty IconURLSelectorProperty = BindableProperty.Create(nameof(IconURLSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
-            if (newValue != null)
-            {
-                instance.InternalIconURLSelector = newValue as StringSelector;
-            }
+            instance.InternalIconURLSelector = newValue as StringSelector;
         },
         defaultValueCreator: (bindable) =>
         {