Avoid nullptr if Gamelist View uses carousel.

This commit is contained in:
Joseph Geumlek 2022-06-26 13:17:44 -07:00
parent 1dcc728291
commit f7eeabeee0

View file

@ -568,6 +568,10 @@ void GamelistBase::populateList(const std::vector<FileData*>& 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<FileData*>& 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) {