Fix creating default theme when default theme file is not present.

This commit is contained in:
Aloshi 2014-01-10 14:58:03 -06:00
parent 330f20f375
commit 2862171dab

View file

@ -315,7 +315,19 @@ const std::shared_ptr<ThemeData>& ThemeData::getDefault()
if(theme == nullptr)
{
theme = std::shared_ptr<ThemeData>(new ThemeData());
theme->loadFile(getHomePath() + "/.emulationstation/es_theme_default.xml");
const std::string path = getHomePath() + "/.emulationstation/es_theme_default.xml";
if(fs::exists(path))
{
try
{
theme->loadFile(path);
} catch(ThemeException& e)
{
LOG(LogError) << e.what();
theme = std::shared_ptr<ThemeData>(new ThemeData()); //reset to empty
}
}
}
return theme;