Fix 'Last Played' collection crash.

This commit is contained in:
Cristi Mitrana 2019-06-12 13:36:48 +03:00
parent 3fdaa2aafb
commit 573cd4cdd5

View file

@ -292,7 +292,7 @@ void CollectionSystemManager::updateCollectionSystem(FileData* file, CollectionS
void CollectionSystemManager::trimCollectionCount(FileData* rootFolder, int limit) void CollectionSystemManager::trimCollectionCount(FileData* rootFolder, int limit)
{ {
SystemData* curSys = rootFolder->getSystem(); SystemData* curSys = rootFolder->getSystem();
while ((int)rootFolder->getChildren().size() > limit) while ((int)rootFolder->getChildrenListToDisplay().size() > limit)
{ {
CollectionFileData* gameToRemove = (CollectionFileData*)rootFolder->getChildrenListToDisplay().back(); CollectionFileData* gameToRemove = (CollectionFileData*)rootFolder->getChildrenListToDisplay().back();
ViewController::get()->getGameListView(curSys).get()->remove(gameToRemove, false); ViewController::get()->getGameListView(curSys).get()->remove(gameToRemove, false);