From df432c6c64590aa29301b94e66176fb5e1c4b794 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 20 Jul 2025 12:10:24 +1000 Subject: [PATCH] Qt: Fix crash booting unscanned games --- src/duckstation-qt/gamelistwidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/duckstation-qt/gamelistwidget.cpp b/src/duckstation-qt/gamelistwidget.cpp index e201484e5..38c0dbe9e 100644 --- a/src/duckstation-qt/gamelistwidget.cpp +++ b/src/duckstation-qt/gamelistwidget.cpp @@ -403,6 +403,8 @@ QIcon GameListModel::getIconForGame(const QString& path) { const auto lock = GameList::GetLock(); const GameList::Entry* entry = GameList::GetEntryForPath(path.toStdString()); + if (!entry) + return ret; if (const QPixmap* pm = m_memcard_pixmap_cache.Lookup(entry->serial)) { @@ -413,7 +415,7 @@ QIcon GameListModel::getIconForGame(const QString& path) else { // See above. - if (entry && !entry->serial.empty() && (entry->IsDisc() || entry->IsDiscSet())) + if (!entry->serial.empty() && (entry->IsDisc() || entry->IsDiscSet())) { const std::string icon_path = GameList::GetGameIconPath(entry->serial, entry->path); if (!icon_path.empty())