Skip to content

Commit 0cb8dde

Browse files
Updated SearchBar Icon changes
1 parent 429699f commit 0cb8dde

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,14 @@ void SearchButtonClicked(object sender, EventArgs e)
796796

797797
void SetSearchBarIcon(UISearchBar searchBar, ImageSource source, UISearchBarIcon icon)
798798
{
799-
source.LoadImage(MauiContext, image =>
799+
var mauiContext = MauiContext ?? Application.Current?.FindMauiContext();
800+
801+
if (mauiContext is null)
802+
{
803+
return;
804+
}
805+
806+
source.LoadImage(mauiContext, image =>
800807
{
801808
var result = image?.Value;
802809
if (result != null)

0 commit comments

Comments
 (0)