From 1761c119d9685d01848c5ff4399c1dada2bd57ec Mon Sep 17 00:00:00 2001 From: Jakub Florkowski Date: Sat, 17 May 2025 16:41:00 +0200 Subject: [PATCH] [iOS] Added a null check for NavPage --- .../Core/src/iOS/Renderers/NavigationRenderer.cs | 5 +++++ .../Handlers/NavigationPage/iOS/NavigationRenderer.cs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs index 6b85dadcdd82..8b2c709b67ed 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs @@ -764,6 +764,11 @@ void UpdateBarTextColor() void SetStatusBarStyle() { + if (NavPage is null) + { + return; + } + var barTextColor = NavPage.BarTextColor; var statusBarColorMode = NavPage.OnThisPlatform().GetStatusBarTextColorMode(); diff --git a/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs index 54366c0e1c15..8b3c8cc5f80e 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs @@ -861,6 +861,11 @@ void UpdateBarTextColor() void SetStatusBarStyle() { + if (NavPage is null) + { + return; + } + var barTextColor = NavPage.BarTextColor; var statusBarColorMode = NavPage.OnThisPlatform().GetStatusBarTextColorMode();