mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 13:56:48 +08:00
~ fixed scene file being loaded before the type of background was checked (fixes crash on #23)
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
parent
39d3f4f1e0
commit
2bd5ea70e3
@ -19,13 +19,6 @@ namespace wp
|
||||
json::const_iterator name_it = this->m_projectFile.find ("title");
|
||||
json::const_iterator type_it = this->m_projectFile.find ("type");
|
||||
|
||||
if (file_it != this->m_projectFile.end ())
|
||||
{
|
||||
// load scene file
|
||||
this->m_file = (*file_it).get <std::string> ().c_str ();
|
||||
this->m_scene = new scene (this->m_file);
|
||||
}
|
||||
|
||||
if (type_it != this->m_projectFile.end ())
|
||||
{
|
||||
this->m_type = type_it.value ();
|
||||
@ -40,6 +33,13 @@ namespace wp
|
||||
{
|
||||
throw std::runtime_error ("Only scene wallpapers are supported");
|
||||
}
|
||||
|
||||
if (file_it != this->m_projectFile.end ())
|
||||
{
|
||||
// load scene file
|
||||
this->m_file = (*file_it).get <std::string> ().c_str ();
|
||||
this->m_scene = new scene (this->m_file);
|
||||
}
|
||||
}
|
||||
|
||||
scene* project::getScene ()
|
||||
|
Loading…
Reference in New Issue
Block a user