Fixed an issue where the random game function would return an empty result.

This commit is contained in:
Leon Styhre 2020-10-20 22:02:33 +02:00
parent eb99e3edeb
commit 844d733c89

View file

@ -573,6 +573,9 @@ FileData* SystemData::getRandomGame(const FileData* currentGame)
{ {
std::vector<FileData*> gameList = mRootFolder->getFilesRecursive(GAME, true); std::vector<FileData*> gameList = mRootFolder->getFilesRecursive(GAME, true);
if (gameList.size() == 1)
return gameList.front();
if (currentGame && currentGame->getType() == PLACEHOLDER) if (currentGame && currentGame->getType() == PLACEHOLDER)
return nullptr; return nullptr;