[NUI] Fix crash on Navigator to check ContentPage.Content correctly
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Wed, 11 May 2022 02:48:07 +0000 (11:48 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 11 May 2022 06:36:39 +0000 (15:36 +0900)
src/Tizen.NUI.Components/Controls/Navigation/Navigator.cs

index 0669606..b6ef1f9 100755 (executable)
@@ -360,7 +360,7 @@ namespace Tizen.NUI.Components
                 page.PositionX = SizeWidth;
                 page.SetVisible(true);
                 // Set Content visible because it was hidden by HideContentOfPage.
-                (page as ContentPage).Content?.SetVisible(true);
+                (page as ContentPage)?.Content?.SetVisible(true);
 
                 newAnimation = new Animation(DefaultTransitionDuration);
                 newAnimation.AnimateTo(page, "PositionX", 0.0f, 0, DefaultTransitionDuration);
@@ -447,7 +447,7 @@ namespace Tizen.NUI.Components
 
                 newTop.SetVisible(true);
                 // Set Content visible because it was hidden by HideContentOfPage.
-                (newTop as ContentPage).Content?.SetVisible(true);
+                (newTop as ContentPage)?.Content?.SetVisible(true);
 
                 newAnimation = new Animation(DefaultTransitionDuration);
                 newAnimation.AnimateTo(newTop, "PositionX", 0.0f, 0, DefaultTransitionDuration);
@@ -744,11 +744,11 @@ namespace Tizen.NUI.Components
         {
             currentTopPage.SetVisible(true);
             // Set Content visible because it was hidden by HideContentOfPage.
-            (currentTopPage as ContentPage).Content?.SetVisible(true);
+            (currentTopPage as ContentPage)?.Content?.SetVisible(true);
 
             newTopPage.SetVisible(true);
             // Set Content visible because it was hidden by HideContentOfPage.
-            (newTopPage as ContentPage).Content?.SetVisible(true);
+            (newTopPage as ContentPage)?.Content?.SetVisible(true);
 
             List<View> taggedViewsInNewTopPage = new List<View>();
             RetrieveTaggedViews(taggedViewsInNewTopPage, newTopPage, true);