fix(settings): fix crash (#3705)

This commit is contained in:
Mr-X-GTA 2024-09-21 10:17:31 +02:00 committed by GitHub
parent a54457d1dc
commit 99e7104b3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -53,11 +53,15 @@ namespace big
{
from_json(m_options, *this);
}
catch (const nlohmann::detail::type_error& e)
catch (const std::exception& e)
{
LOG(WARNING) << e.what();
file.close();
return false;
LOG(WARNING) << "Detected incompatible settings, writing default config: " << e.what();
write_default_config();
return load();
}
if (should_save)
@ -101,6 +105,12 @@ namespace big
{
current_settings[key] = e.value();
should_save = true;
}
else if (current_settings[key].size() < e.value().size())
{
current_settings[key] = e.value();
should_save = true;
}
}