mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 20:17:24 +08:00
fix(settings): fix crash
This commit is contained in:
parent
220322b910
commit
52aec520fc
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user