Skip to content

Commit

Permalink
Fixup: Check if selected language is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelKlaer committed May 3, 2023
1 parent 649724e commit e353bb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Minesweeper/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ private static void Run()
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();

// Detect user language if none was set
if (string.IsNullOrEmpty(Properties.Settings.Default.Language))
// Detect user language if none was set or if it's invalid
if (string.IsNullOrEmpty(Properties.Settings.Default.Language) || !LanguageController.AvailableLanguages.Contains(Properties.Settings.Default.Language))
{
LanguageController.ApplyOsLanguage();
Properties.Settings.Default.Language = LanguageController.CurrentLanguage;
Expand Down

0 comments on commit e353bb0

Please sign in to comment.