fix: Compare Presets crash on filaments with different variant counts (#16176)

This commit is contained in:
Kris Austin
2026-10-05 21:20:12 -03:00
committed by GitHub
parent fefedb66c4
commit 9e5bfc272c
3 changed files with 45 additions and 0 deletions
+4
View File
@@ -53,6 +53,8 @@ wxString get_string_from_enum(const std::string& opt_key, const DynamicPrintConf
}
return _L("Undefined");
}
if (val < 0 || val >= int(names.size()))
return _L("Undefined");
return from_u8(_utf8(names[val]));
}
@@ -215,6 +217,8 @@ wxString get_string_value(const std::string& opt_key, const DynamicPrintConfig&
;
}
case coEnums: {
if (!opt_vector || opt_idx >= opt_vector->size())
return _L("Undefined");
return get_string_from_enum(pure_key, config,
pure_key == "top_surface_pattern" ||
pure_key == "bottom_surface_pattern" ||