mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Improved resilience to empty gamelist.xml files (they can now be updated instead of generating an error)
This commit is contained in:
parent
cd4a7d4414
commit
630ff4a0d7
|
@ -135,6 +135,12 @@ namespace GamelistFileParser
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Utils::FileSystem::getFileSize(xmlpath) == 0) {
|
||||||
|
LOG(LogWarning) << "GamelistFileParser::parseGamelist(): System \"" << system->getName()
|
||||||
|
<< "\" has an empty gamelist.xml file";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
LOG(LogInfo) << "Parsing gamelist file \"" << Utils::String::replace(xmlpath, "/", "\\")
|
LOG(LogInfo) << "Parsing gamelist file \"" << Utils::String::replace(xmlpath, "/", "\\")
|
||||||
<< "\"...";
|
<< "\"...";
|
||||||
|
@ -340,7 +346,8 @@ namespace GamelistFileParser
|
||||||
const std::string& xmlReadPath {system->getGamelistPath(false)};
|
const std::string& xmlReadPath {system->getGamelistPath(false)};
|
||||||
bool hasAlternativeEmulatorTag {false};
|
bool hasAlternativeEmulatorTag {false};
|
||||||
|
|
||||||
if (Utils::FileSystem::exists(xmlReadPath)) {
|
if (Utils::FileSystem::exists(xmlReadPath) &&
|
||||||
|
Utils::FileSystem::getFileSize(xmlReadPath) != 0) {
|
||||||
// Parse an existing file first.
|
// Parse an existing file first.
|
||||||
|
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
|
|
Loading…
Reference in a new issue