Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ bool DidPopItem(UINavigationBar _, UINavigationItem __)

// Bounds check: ensure we have a valid index for pages array
int targetIndex = NavigationBar.Items.Length - 1;
if (targetIndex < 0 || targetIndex >= pages.Count)
if (targetIndex < 0 || targetIndex >= pages.Count || pages[targetIndex] is null)
return true;

_shellSection.SyncStackDownTo(pages[targetIndex]);
Expand Down Expand Up @@ -577,10 +577,7 @@ Element ElementForViewController(UIViewController viewController)

foreach (var child in ShellSection.Stack)
{
if (child == null)
continue;
var renderer = (IPlatformViewHandler)child.Handler;
if (viewController == renderer.ViewController)
if (child?.Handler is IPlatformViewHandler { ViewController: var vc } && viewController == vc)
return child;
}

Expand Down
Loading