From a65b0b2a3c30aa8d2add83768a45d282cc066744 Mon Sep 17 00:00:00 2001 From: Alexander Heubusch Date: Fri, 27 Sep 2024 15:59:50 +0200 Subject: [PATCH] [iOS] Fix NRE in Shell SearchHandlerAppearanceTracker --- .../Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs index 2aab09f240b5..ecea8c950e70 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs @@ -262,7 +262,7 @@ void UpdateClearPlaceholderIconColor(Color targetColor) SetSearchBarIconColor(uiButton, targetColor, _defaultPlaceholderTintColor); - uiButton.TintColor = targetColor.ToPlatform() ?? _defaultPlaceholderTintColor; + uiButton.TintColor = targetColor?.ToPlatform() ?? _defaultPlaceholderTintColor; } void UpdateClearIconColor(Color targetColor) @@ -373,7 +373,7 @@ static void SetSearchBarIconColor(UIButton button, Color targetColor, UIColor de button.SetImage(newIcon, UIControlState.Normal); button.SetImage(newIcon, UIControlState.Selected); button.SetImage(newIcon, UIControlState.Highlighted); - button.TintColor = button.ImageView.TintColor = targetColor != null ? targetColor.ToPlatform() : defaultTintColor; + button.TintColor = button.ImageView.TintColor = targetColor?.ToPlatform() ?? defaultTintColor; } protected virtual void Dispose(bool disposing)