Skip to content

Commit

Permalink
Merge pull request #345 from jibedoubleve/issue/334
Browse files Browse the repository at this point in the history
(#334) Update web icon when alias is an URL
  • Loading branch information
jibedoubleve authored Oct 26, 2023
2 parents defe230 + 5e880bd commit 5dc75d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Lanceur.Core/Models/AliasQueryResultMixin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ public static class AliasQueryResultMixin

public static void UpdateIcon(this AliasQueryResult alias)
{
if (Uri.TryCreate(alias.FileName, UriKind.Absolute, out _))
if (alias is null) return;

var uri = alias.FileName ?? string.Empty;
if (Uri.TryCreate(uri, UriKind.Absolute, out _)
&& uri.StartsWith("http"))
{
alias.Icon = "Web";
}
Expand Down

0 comments on commit 5dc75d0

Please sign in to comment.