From ab1129b2a0aeaa6ecdb4b6da8c13173d0d9d2c63 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Thu, 12 Jan 2023 19:07:29 +0100 Subject: [PATCH] Fixed a rare crash that could occur when enabling collections. --- es-app/src/views/ViewController.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index e4f87c47f..1fba34548 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -1193,8 +1193,11 @@ void ViewController::reloadAll() // Clear all GamelistViews. std::map cursorMap; - for (auto it = mGamelistViews.cbegin(); it != mGamelistViews.cend(); ++it) - cursorMap[it->first] = it->second->getCursor(); + for (auto it = mGamelistViews.cbegin(); it != mGamelistViews.cend(); ++it) { + if (std::find(SystemData::sSystemVector.cbegin(), SystemData::sSystemVector.cend(), + (*it).first) != SystemData::sSystemVector.cend()) + cursorMap[it->first] = it->second->getCursor(); + } mGamelistViews.clear(); mCurrentView = nullptr;