Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add null check for TabbedPage.Current in OnNavTo/From #2577

Merged
merged 2 commits into from
Oct 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Forms/Prism.Forms/Navigation/PageNavigationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ private static void OnNavigatedTo(Page toPage, INavigationParameters parameters)
{
PageUtilities.OnNavigatedTo(toPage, parameters);

if (toPage is TabbedPage tabbedPage)
if (toPage is TabbedPage tabbedPage && tabbedPage.CurrentPage != null)
{
if (tabbedPage.CurrentPage is NavigationPage navigationPage)
{
Expand All @@ -825,7 +825,7 @@ private static void OnNavigatedFrom(Page fromPage, INavigationParameters paramet
{
PageUtilities.OnNavigatedFrom(fromPage, parameters);

if (fromPage is TabbedPage tabbedPage)
if (fromPage is TabbedPage tabbedPage && tabbedPage.CurrentPage != null)
{
if (tabbedPage.CurrentPage is NavigationPage navigationPage)
{
Expand Down