Skip to content

[iOS] System.NullReferenceException at NavigationRenderer.SetStatusBarStyle() #29564

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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 @@ -764,6 +764,11 @@ void UpdateBarTextColor()

void SetStatusBarStyle()
{
if (NavPage is null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the fix looks correct, this changes worry me that we could be hiding an error or the real reason, do we know the origin of the error? Maybe we should check HasNavigationBar and avoid invalidating something first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be really nice if we can achieve to have a test, because in that way we could know exactly what's happening. Reading the issue seems to be related with use a FlyoutPage and HasNavigationBar, but not sure how to reproduce it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, but, I’m currently unable to reproduce the issue. I’m waiting for the reporter to either provide clear reproduction steps or confirm whether this PR resolves the crash.

{
return;
}

var barTextColor = NavPage.BarTextColor;
var statusBarColorMode = NavPage.OnThisPlatform().GetStatusBarTextColorMode();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,11 @@ void UpdateBarTextColor()

void SetStatusBarStyle()
{
if (NavPage is null)
{
return;
}

var barTextColor = NavPage.BarTextColor;
var statusBarColorMode = NavPage.OnThisPlatform().GetStatusBarTextColorMode();

Expand Down
Loading