Log warning if cannot find matched theme

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Jack Ye 2025-04-08 16:20:11 +08:00 committed by GitHub
parent b3aa89773c
commit a2d9957385
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -384,7 +384,12 @@ namespace Flow.Launcher.Core.Resource
public ThemeData GetCurrentTheme()
{
var themes = GetAvailableThemes();
return themes.FirstOrDefault(t => t.FileNameWithoutExtension == _settings.Theme) ?? themes.FirstOrDefault();
var matchingTheme = themes.FirstOrDefault(t => t.FileNameWithoutExtension == _settings.Theme);
if (matchingTheme == null)
{
Log.Warn($"No matching theme found for '{_settings.Theme}'. Falling back to the first available theme.");
}
return matchingTheme ?? themes.FirstOrDefault();
}
public List<ThemeData> GetAvailableThemes()