mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-04 10:48:00 -05:00
fix: Compare Presets crash on filaments with different variant counts (#16176)
This commit is contained in:
1 parent
fefedb66c4
commit
9e5bfc272c
3 files changed
+45
No files matched your search
@@ -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" ||
|
||||
|
||||
Reference in new issue
Block a user