Skip to content

Commit

Permalink
🐛 fix(Icon): an exception thrown when an alias cannot be found (#2121)
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem authored Aug 28, 2024
1 parent 8e9e46d commit 489165f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Masa.Blazor/Components/Icon/MIcon.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,15 @@ protected void InitIcon()
return;
}

if (iconText.StartsWith("$"))
if (iconText.StartsWith('$'))
{
icon = MasaBlazor.Icons.Aliases.GetIconOrDefault(iconText);

// If the icon is not found, return
if (icon is null)
{
return;
}
}
else
{
Expand Down

0 comments on commit 489165f

Please sign in to comment.