[QuickAccent]Fix unstable language loading (#36721)

This commit is contained in:
Jaime Bernardo
2025-01-13 15:13:50 +00:00
committed by GitHub
parent df48a33bb9
commit 4951a63352
2 changed files with 11 additions and 0 deletions

View File

@@ -115,6 +115,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
SelectedLanguageOptions = _powerAccentSettings.Properties.SelectedLang.Value.Split(',')
.Select(l => Languages.Find(lang => lang.LanguageCode == l))
.Where(l => l != null) // Wrongly typed languages will appear as null after find. We want to remove those to avoid crashes.
.ToArray();
}
else if (_powerAccentSettings.Properties.SelectedLang.Value.Contains("ALL"))