mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-17 22:55:38 +00:00
Fix creating default theme when default theme file is not present.
This commit is contained in:
parent
330f20f375
commit
2862171dab
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue