From f7eeabeee0890a3e24f14692b0eb37e41a973e5c Mon Sep 17 00:00:00 2001 From: Joseph Geumlek Date: Sun, 26 Jun 2022 13:17:44 -0700 Subject: [PATCH] Avoid nullptr if Gamelist View uses carousel. --- es-app/src/views/GamelistBase.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/es-app/src/views/GamelistBase.cpp b/es-app/src/views/GamelistBase.cpp index b25ca6cd9..1f8497796 100644 --- a/es-app/src/views/GamelistBase.cpp +++ b/es-app/src/views/GamelistBase.cpp @@ -568,6 +568,10 @@ void GamelistBase::populateList(const std::vector& files, FileData* f if (files.size() > 0) { for (auto it = files.cbegin(); it != files.cend(); ++it) { + + if (!mFirstGameEntry && (*it)->getType() == GAME) + mFirstGameEntry = (*it); + if (mCarousel != nullptr) { assert(carouselItemType != ""); @@ -586,9 +590,6 @@ void GamelistBase::populateList(const std::vector& files, FileData* f std::string indicators {mTextList->getIndicators()}; std::string collectionIndicators {mTextList->getCollectionIndicators()}; - if (!mFirstGameEntry && (*it)->getType() == GAME) - mFirstGameEntry = (*it); - // Add a leading tick mark icon to the game name if it's part of the custom // collection currently being edited. if (isEditing && (*it)->getType() == GAME) {