Skip to content

Commit 26cb0cd

Browse files
kubaflosheiksyedm
authored andcommitted
[iOS] System.NullReferenceException at NavigationRenderer.SetStatusBarStyle() (#29564)
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issues Fixed Fixes #29535
1 parent 68499a3 commit 26cb0cd

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,11 @@ void UpdateBarTextColor()
762762

763763
void SetStatusBarStyle()
764764
{
765+
if (NavPage is null)
766+
{
767+
return;
768+
}
769+
765770
var barTextColor = NavPage.BarTextColor;
766771
var statusBarColorMode = NavPage.OnThisPlatform().GetStatusBarTextColorMode();
767772

src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,11 @@ void UpdateBarTextColor()
968968

969969
void SetStatusBarStyle()
970970
{
971+
if (NavPage is null)
972+
{
973+
return;
974+
}
975+
971976
var barTextColor = NavPage.BarTextColor;
972977
var statusBarColorMode = NavPage.OnThisPlatform().GetStatusBarTextColorMode();
973978

0 commit comments

Comments
 (0)