Skip to content

Commit 9eeb04e

Browse files
committed
fix logic
1 parent b86a2a8 commit 9eeb04e

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Flow.Launcher/ViewModel/ResultViewModel.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,20 @@ public ResultViewModel(Result result, Settings settings)
6868
OnPropertyChanged(nameof(Image));
6969
});
7070

71-
if (Result.Glyph.FontFamily.Contains('/'))
71+
if (Result.Glyph is { FontFamily: not null } glyph)
7272
{
73-
var fontPath = Result.Glyph.FontFamily;
74-
Glyph = Path.IsPathRooted(fontPath) ? Result.Glyph : Result.Glyph with
73+
if (glyph.FontFamily.Contains('/'))
7574
{
76-
FontFamily = Path.Combine(Result.PluginDirectory, fontPath)
77-
};
78-
}
79-
else
80-
{
81-
Glyph = Result.Glyph;
75+
var fontPath = Result.Glyph.FontFamily;
76+
Glyph = Path.IsPathRooted(fontPath) ? Result.Glyph : Result.Glyph with
77+
{
78+
FontFamily = Path.Combine(Result.PluginDirectory, fontPath)
79+
};
80+
}
81+
else
82+
{
83+
Glyph = glyph;
84+
}
8285
}
8386
}
8487

0 commit comments

Comments
 (0)