[NUI] Fix NUI.Components test case fail (#2815)
authorSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Wed, 31 Mar 2021 02:18:29 +0000 (11:18 +0900)
committerGitHub <noreply@github.com>
Wed, 31 Mar 2021 02:18:29 +0000 (11:18 +0900)
- Should have added null check for indeterminateImage instance

Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
src/Tizen.NUI.Components/Controls/Progress.cs

index 75018c4..140f30c 100755 (executable)
@@ -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();
+            }
         }
 
         /// <summary>
@@ -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();
             }