diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2023-01-22 13:14:38 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-22 13:14:38 -0500 |
| commit | 78df1ddce8853255863adbe14bdfb7abf60319fe (patch) | |
| tree | 84b92ac30a0bf7062efab520e8e49f159b39d8cc /src/yuzu/configuration/configure_system.cpp | |
| parent | 9184b6ed2bbc2547c431fd9453c0de8de5dec3c3 (diff) | |
| parent | a43646715245a95aa2e75703ca950cc8e4accb92 (diff) | |
Merge pull request #9660 from german77/koreaToTaiwan
yuzu: Fix language comobox crash
Diffstat (limited to 'src/yuzu/configuration/configure_system.cpp')
| -rw-r--r-- | src/yuzu/configuration/configure_system.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 94049f2f4..9ea4c02da 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp @@ -31,6 +31,9 @@ constexpr std::array<u32, 7> LOCALE_BLOCKLIST{ }; static bool IsValidLocale(u32 region_index, u32 language_index) { + if (region_index >= LOCALE_BLOCKLIST.size()) { + return false; + } return ((LOCALE_BLOCKLIST.at(region_index) >> language_index) & 1) == 0; } @@ -55,8 +58,11 @@ ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent) }); const auto locale_check = [this](int index) { - const bool valid_locale = - IsValidLocale(ui->combo_region->currentIndex(), ui->combo_language->currentIndex()); + const auto region_index = ConfigurationShared::GetComboboxIndex( + Settings::values.region_index.GetValue(true), ui->combo_region); + const auto language_index = ConfigurationShared::GetComboboxIndex( + Settings::values.language_index.GetValue(true), ui->combo_language); + const bool valid_locale = IsValidLocale(region_index, language_index); ui->label_warn_invalid_locale->setVisible(!valid_locale); if (!valid_locale) { ui->label_warn_invalid_locale->setText( |
