fix remove_invalid_keys on an erased config instead of the preset config (PR #12127 from @supermerill, SPE-2127):

see supermerill/SuperSlicer/issues/4079
This commit is contained in:
Merill 2024-01-25 12:02:27 +01:00 committed by Lukas Matena
parent 1c6282ce03
commit aa5573e8b9

View File

@ -749,7 +749,7 @@ void PresetCollection::load_presets(
preset.config.apply(std::move(config));
Preset::normalize(preset.config);
// Report configuration fields, which are misplaced into a wrong group.
std::string incorrect_keys = Preset::remove_invalid_keys(config, default_preset.config);
std::string incorrect_keys = Preset::remove_invalid_keys(preset.config, default_preset.config);
if (! incorrect_keys.empty())
BOOST_LOG_TRIVIAL(error) << "Error in a preset file: The preset \"" <<
preset.file << "\" contains the following incorrect keys: " << incorrect_keys << ", which were removed";