Merge pull request #323 from pjft/empty-favorites-fix

Fixes favorites crashing when removing last entry
This commit is contained in:
Jools Wills 2017-12-01 17:39:18 +00:00 committed by GitHub
commit ebe0101d4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,7 +111,7 @@ void BasicGameListView::remove(FileData *game, bool deleteFile)
{
std::vector<FileData*> siblings = parent->getChildrenListToDisplay();
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 ((gamePos + 1) < siblings.size())