You've already forked emulationstation-next
mirror of
https://github.com/archr-linux/emulationstation-next.git
synced 2026-07-13 03:19:12 -07:00
Fix crash: empty lines in m3u files and folder deletion in removeMultiDiskContent
- FileData: Skip lines where trim[0] == '\0' in m3u parsing (empty lines) - SystemData: Check getType() == GAME before deleting fileMap entries to prevent accidentally deleting folder entries that match content file paths Cherry-picked fixes from ROCKNIX 39fde1086 (adapted to our codebase) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -911,7 +911,7 @@ std::set<std::string> FileData::getContentFiles()
|
||||
while (std::getline(m3u, line))
|
||||
{
|
||||
auto trim = Utils::String::trim(line);
|
||||
if (trim[0] == '#' || trim[0] == '\\' || trim[0] == '/')
|
||||
if (trim[0] == '#' || trim[0] == '\\' || trim[0] == '/' || trim[0] == '\0')
|
||||
continue;
|
||||
|
||||
files.insert(path + "/" + trim);
|
||||
|
||||
@@ -197,7 +197,7 @@ void SystemData::removeMultiDiskContent(std::unordered_map<std::string, FileData
|
||||
for (const auto& file : files)
|
||||
{
|
||||
auto it = fileMap.find(file);
|
||||
if (it != fileMap.cend())
|
||||
if (it != fileMap.cend() && it->second->getType() == GAME)
|
||||
{
|
||||
delete it->second;
|
||||
fileMap.erase(it);
|
||||
|
||||
Reference in New Issue
Block a user