Skip to content

Commit

Permalink
Game List: Ignore exclusion paths if they are empty string
Browse files Browse the repository at this point in the history
Works around a bug of unknown origin which causes empty string to be added to the exclusions list, clearing the games list completely.
  • Loading branch information
RedPanda4552 authored and stenzek committed Jan 16, 2024
1 parent 54c620a commit cdd38ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pcsx2/GameList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ void GameList::RewriteCacheFile()

static bool IsPathExcluded(const std::vector<std::string>& excluded_paths, const std::string& path)
{
return std::find_if(excluded_paths.begin(), excluded_paths.end(), [&path](const std::string& entry) { return path.starts_with(entry); }) != excluded_paths.end();
return std::find_if(excluded_paths.begin(), excluded_paths.end(), [&path](const std::string& entry) { return !entry.empty() && path.starts_with(entry); }) != excluded_paths.end();
}

void GameList::ScanDirectory(const char* path, bool recursive, bool only_cache, const std::vector<std::string>& excluded_paths,
Expand Down

0 comments on commit cdd38ef

Please sign in to comment.