From 6bd86c1a157e4ba75da5c515cf880c735fa6ebb2 Mon Sep 17 00:00:00 2001 From: Seoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:18:29 +0900 Subject: [PATCH] [NUI] Fix NUI.Components test case fail (#2815) - Should have added null check for indeterminateImage instance Signed-off-by: Seoyeon Kim --- src/Tizen.NUI.Components/Controls/Progress.cs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/Tizen.NUI.Components/Controls/Progress.cs b/src/Tizen.NUI.Components/Controls/Progress.cs index 75018c4..140f30c 100755 --- a/src/Tizen.NUI.Components/Controls/Progress.cs +++ b/src/Tizen.NUI.Components/Controls/Progress.cs @@ -483,9 +483,12 @@ namespace Tizen.NUI.Components { indeterminateAnimation?.Stop(); - indeterminateAnimation = AnimateVisual(indeterminateImage, "pixelArea", destinationValue, 0, 1000, AlphaFunction.BuiltinFunctions.Default, initialValue); - indeterminateAnimation.Looping = true; - indeterminateAnimation.Play(); + if (null != indeterminateImage) + { + indeterminateAnimation = AnimateVisual(indeterminateImage, "pixelArea", destinationValue, 0, 1000, AlphaFunction.BuiltinFunctions.Default, initialValue); + indeterminateAnimation.Looping = true; + indeterminateAnimation.Play(); + } } /// @@ -510,7 +513,10 @@ namespace Tizen.NUI.Components indeterminateAnimation?.Stop(); indeterminateAnimation = null; - indeterminateImage.Opacity = 0.0f; + if (null != indeterminateImage) + { + indeterminateImage.Opacity = 0.0f; + } progressImage.Hide(); bufferImage.Show(); } @@ -519,7 +525,10 @@ namespace Tizen.NUI.Components indeterminateAnimation?.Stop(); indeterminateAnimation = null; - indeterminateImage.Opacity = 0.0f; + if (null != indeterminateImage) + { + indeterminateImage.Opacity = 0.0f; + } bufferImage.Show(); progressImage.Show(); @@ -529,7 +538,10 @@ namespace Tizen.NUI.Components { bufferImage.Hide(); progressImage.Hide(); - indeterminateImage.Opacity = 1.0f; + if (null != indeterminateImage) + { + indeterminateImage.Opacity = 1.0f; + } UpdateIndeterminateAnimation(); } -- 2.7.4