From cdd38ef7aaf7389db12b6da0d2cc75d0bbc1d4bb Mon Sep 17 00:00:00 2001 From: RedPanda4552 Date: Tue, 16 Jan 2024 01:50:45 -0500 Subject: [PATCH] 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. --- pcsx2/GameList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/GameList.cpp b/pcsx2/GameList.cpp index d271f3e8c5..1e7c979ae0 100644 --- a/pcsx2/GameList.cpp +++ b/pcsx2/GameList.cpp @@ -582,7 +582,7 @@ void GameList::RewriteCacheFile() static bool IsPathExcluded(const std::vector& 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& excluded_paths,