fix crash due to not checking if setting is loaded

This commit is contained in:
HJfod 2024-08-23 22:55:43 +03:00
parent 8ce5700aad
commit 36853b785c

View file

@ -178,6 +178,9 @@ Result<> ModSettingsManager::load(matjson::Value const& json) {
} }
void ModSettingsManager::save(matjson::Value& json) { void ModSettingsManager::save(matjson::Value& json) {
for (auto& [key, sett] : m_impl->settings) { for (auto& [key, sett] : m_impl->settings) {
if (!sett.v3) {
continue;
}
// Store the value in an intermediary so if `save` fails the existing // Store the value in an intermediary so if `save` fails the existing
// value loaded from disk isn't overwritten // value loaded from disk isn't overwritten
matjson::Value value; matjson::Value value;