From d1b904a1da41d4d6caed7bf45fa353b055547c28 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 27 Nov 2024 12:43:15 +1000 Subject: [PATCH] Qt: Fix game properties crash opening non-DB game --- src/duckstation-qt/gamesummarywidget.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/duckstation-qt/gamesummarywidget.cpp b/src/duckstation-qt/gamesummarywidget.cpp index aa72ccbba..31f005b42 100644 --- a/src/duckstation-qt/gamesummarywidget.cpp +++ b/src/duckstation-qt/gamesummarywidget.cpp @@ -53,8 +53,9 @@ GameSummaryWidget::GameSummaryWidget(const std::string& path, const std::string& } // I hate this so much. - m_ui.customLanguage->addItem(QtUtils::GetIconForLanguage(entry->GetLanguageFlagName(region)), - tr("Show Default Flag")); + const std::string_view default_language = + 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(GameDatabase::Language::MaxCount); i++) { const char* language_name = GameDatabase::GetLanguageName(static_cast(i));