mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +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)
|
if(theme == nullptr)
|
||||||
{
|
{
|
||||||
theme = std::shared_ptr<ThemeData>(new ThemeData());
|
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;
|
return theme;
|
||||||
|
|
Loading…
Reference in a new issue