Fixed a crash when unflagging the last file entry as favorite.

This commit is contained in:
Leon Styhre 2020-10-25 19:13:19 +01:00
parent e51c7ddf8c
commit 546f6304ef

View file

@ -307,7 +307,9 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
// Jump to the first entry in the gamelist if the last favorite was unmarked.
if (foldersOnTop && removedLastFavorite &&
!entryToUpdate->getSystem()->isCustomCollection())
setCursor(getFirstGameEntry());
ViewController::get()->getGameListView(entryToUpdate->getSystem())->
setCursor(ViewController::get()->getGameListView(entryToUpdate->
getSystem())->getFirstGameEntry());
else if (removedLastFavorite &&
!entryToUpdate->getSystem()->isCustomCollection())
setCursor(getFirstEntry());