mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Fixed an issue where attempting to create the system directories with invalid entries in es_systems.xml could crash the application
This commit is contained in:
parent
cfb71c378f
commit
80a462abb3
|
@ -1122,6 +1122,18 @@ bool SystemData::createSystemDirectories()
|
|||
return (std::isspace(character) || character == ',');
|
||||
}) != platform.cend()};
|
||||
|
||||
if (name.empty()) {
|
||||
LOG(LogError)
|
||||
<< "A system in the es_systems.xml file has no name defined, skipping entry";
|
||||
continue;
|
||||
}
|
||||
else if (fullname.empty() || path.empty() || extensions.empty() || commands.empty()) {
|
||||
LOG(LogError) << "System \"" << name
|
||||
<< "\" is missing the fullname, path, "
|
||||
"extension, or command tag, skipping entry";
|
||||
continue;
|
||||
}
|
||||
|
||||
themeFolder = system.child("theme").text().as_string(name.c_str());
|
||||
|
||||
// Check that the %ROMPATH% variable is actually used for the path element.
|
||||
|
@ -1203,7 +1215,10 @@ bool SystemData::createSystemDirectories()
|
|||
}
|
||||
systemInfoFile << "Platform" << (multiplePlatforms ? "s" : "")
|
||||
<< " (for scraping):" << std::endl;
|
||||
systemInfoFile << platform << std::endl << std::endl;
|
||||
if (platform.empty())
|
||||
systemInfoFile << "None defined" << std::endl << std::endl;
|
||||
else
|
||||
systemInfoFile << platform << std::endl << std::endl;
|
||||
systemInfoFile << "Theme folder:" << std::endl;
|
||||
systemInfoFile << themeFolder << std::endl;
|
||||
systemInfoFile.close();
|
||||
|
|
Loading…
Reference in a new issue