Qt: Fix game properties crash opening non-DB game

This commit is contained in:
Stenzek 2024-11-27 12:43:15 +10:00
parent 0befbf8021
commit d1b904a1da
No known key found for this signature in database
1 changed files with 3 additions and 2 deletions

View File

@ -53,8 +53,9 @@ GameSummaryWidget::GameSummaryWidget(const std::string& path, const std::string&
} }
// I hate this so much. // I hate this so much.
m_ui.customLanguage->addItem(QtUtils::GetIconForLanguage(entry->GetLanguageFlagName(region)), const std::string_view default_language =
tr("Show Default Flag")); entry ? entry->GetLanguageFlagName(region) : Settings::GetDiscRegionName(region);
m_ui.customLanguage->addItem(QtUtils::GetIconForLanguage(default_language), tr("Show Default Flag"));
for (u32 i = 0; i < static_cast<u32>(GameDatabase::Language::MaxCount); i++) for (u32 i = 0; i < static_cast<u32>(GameDatabase::Language::MaxCount); i++)
{ {
const char* language_name = GameDatabase::GetLanguageName(static_cast<GameDatabase::Language>(i)); const char* language_name = GameDatabase::GetLanguageName(static_cast<GameDatabase::Language>(i));