fix logic

This commit is contained in:
Kevin Zhang 2021-08-06 17:15:10 +08:00
parent b86a2a8f5f
commit 9eeb04ec13

View file

@ -68,17 +68,20 @@ namespace Flow.Launcher.ViewModel
OnPropertyChanged(nameof(Image));
});
if (Result.Glyph.FontFamily.Contains('/'))
if (Result.Glyph is { FontFamily: not null } glyph)
{
var fontPath = Result.Glyph.FontFamily;
Glyph = Path.IsPathRooted(fontPath) ? Result.Glyph : Result.Glyph with
if (glyph.FontFamily.Contains('/'))
{
FontFamily = Path.Combine(Result.PluginDirectory, fontPath)
};
}
else
{
Glyph = Result.Glyph;
var fontPath = Result.Glyph.FontFamily;
Glyph = Path.IsPathRooted(fontPath) ? Result.Glyph : Result.Glyph with
{
FontFamily = Path.Combine(Result.PluginDirectory, fontPath)
};
}
else
{
Glyph = glyph;
}
}
}