Game List: Ignore exclusion paths if they are empty string

Works around a bug of unknown origin which causes empty string to be added to the exclusions list, clearing the games list completely.
This commit is contained in:
RedPanda4552 2024-01-16 01:50:45 -05:00 committed by Connor McLaughlin
parent 54c620a5df
commit cdd38ef7aa

View File

@ -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,