From 36853b785c05e7d1356d784e759cdbcc104d70e4 Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Fri, 23 Aug 2024 22:55:43 +0300 Subject: [PATCH] fix crash due to not checking if setting is loaded --- loader/src/loader/ModSettingsManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/loader/src/loader/ModSettingsManager.cpp b/loader/src/loader/ModSettingsManager.cpp index b64fc3a6..96412fec 100644 --- a/loader/src/loader/ModSettingsManager.cpp +++ b/loader/src/loader/ModSettingsManager.cpp @@ -178,6 +178,9 @@ Result<> ModSettingsManager::load(matjson::Value const& json) { } void ModSettingsManager::save(matjson::Value& json) { for (auto& [key, sett] : m_impl->settings) { + if (!sett.v3) { + continue; + } // Store the value in an intermediary so if `save` fails the existing // value loaded from disk isn't overwritten matjson::Value value;