Skip to content

Commit

Permalink
Merge pull request #3180 from PrismLibrary/dev/ds/null-reference-fix
Browse files Browse the repository at this point in the history
fix: null reference on TabbedPage evaluation
  • Loading branch information
brianlagunas authored Jul 4, 2024
2 parents 7be5a56 + b4ba49a commit e64870b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Maui/Prism.Maui/Navigation/PageNavigationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ private static void OnNavigatedTo(Page toPage, INavigationParameters parameters)
{
MvvmHelpers.OnNavigatedTo(navigationPage.CurrentPage, parameters);
}
else if (tabbedPage.BindingContext != tabbedPage.CurrentPage.BindingContext)
else if (tabbedPage.BindingContext != tabbedPage.CurrentPage?.BindingContext)
{
MvvmHelpers.OnNavigatedTo(tabbedPage.CurrentPage, parameters);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public NavigationTests(ITestOutputHelper testOutputHelper)
[InlineData("MockHome/NavigationPage/MockViewA")]
[InlineData("MockExplicitTabbedPage")]
[InlineData("TabbedPage?createTab=NavigationPage%2FMockViewA%2FMockViewB%3Fid%3D5%2FMockViewC&createTab=MockViewD")]
[InlineData("NavigationPage/MockViewB/TabbedPage?createTab=MockViewA/MockViewC")]
public void PagesInjectScopedInstanceOfIPageAccessor(string uri)
{
var mauiApp = CreateBuilder(prism => prism.CreateWindow(uri))
Expand Down
4 changes: 0 additions & 4 deletions tests/Maui/Prism.Maui.Tests/Prism.Maui.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,4 @@
<ProjectReference Include="..\..\..\src\Maui\Prism.Maui\Prism.Maui.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Fixtures\Mvvm\" />
</ItemGroup>

</Project>

0 comments on commit e64870b

Please sign in to comment.