Fix dashboard crash with empty configuration

This commit is contained in:
Patrick Nicolas
2025-11-09 23:45:27 +01:00
parent 87d024e78b
commit 1d481f7b77
+4 -1
View File
@@ -129,12 +129,15 @@ void Settings::load(const wivrn_server * server)
{
auto conf = server->jsonConfiguration();
m_jsonSettings = nlohmann::json::parse(conf.toUtf8());
if (not m_jsonSettings.is_object())
m_jsonSettings = nlohmann::json::object();
emitAllChanged();
}
catch (std::exception & e)
{
qWarning() << "Cannot read configuration: " << e.what();
restore_defaults();
m_jsonSettings = nlohmann::json::object();
emitAllChanged();
return;
}
}