Fixes favorites crashing when removing last entry

Regression somewhere down the line.
This commit is contained in:
pjft 2017-12-01 17:23:28 +00:00
parent ca046f75f1
commit f29452e533

View file

@ -111,7 +111,7 @@ void BasicGameListView::remove(FileData *game, bool deleteFile)
{ {
std::vector<FileData*> siblings = parent->getChildrenListToDisplay(); std::vector<FileData*> siblings = parent->getChildrenListToDisplay();
auto gameIter = std::find(siblings.cbegin(), siblings.cend(), game); auto gameIter = std::find(siblings.cbegin(), siblings.cend(), game);
unsigned int gamePos = (int)std::distance(siblings.cbegin(), gameIter); int gamePos = (int)std::distance(siblings.cbegin(), gameIter);
if (gameIter != siblings.cend()) if (gameIter != siblings.cend())
{ {
if ((gamePos + 1) < siblings.size()) if ((gamePos + 1) < siblings.size())