mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-04 08:42:10 +00:00
FIX: object params variant crash
Change-Id: Ia67b98c29a0cc97f8479911ffdefb942cb6c751f Jira: none (cherry picked from commit 8bf65c0963d1ee39bba12f67f33177d4ac6d6a60)
This commit is contained in:
@@ -453,10 +453,12 @@ void ConfigBase::apply_only(const ConfigBase &other, const t_config_option_keys
|
||||
// This is only possible if other is of DynamicConfig type.
|
||||
if (auto n = opt_key.find('#'); n != std::string::npos) {
|
||||
auto opt_key2 = opt_key.substr(0, n);
|
||||
auto my_opt2 = dynamic_cast<ConfigOptionVectorBase*>(this->option(opt_key2, true));
|
||||
auto my_opt2 = dynamic_cast<ConfigOptionVectorBase*>(this->option(opt_key2));
|
||||
auto other_opt = other.option(opt_key2);
|
||||
if (my_opt2 == nullptr && other_opt)
|
||||
my_opt2 = dynamic_cast<ConfigOptionVectorBase*>(other_opt->clone());
|
||||
if (my_opt2) {
|
||||
int index = std::atoi(opt_key.c_str() + n + 1);
|
||||
auto other_opt = other.option(opt_key2);
|
||||
if (other_opt)
|
||||
my_opt2->set_at(other_opt, index, index);
|
||||
continue;
|
||||
|
||||
@@ -527,6 +527,10 @@ std::vector<std::map<int, int>> get_extruder_ams_count(const std::vector<std::st
|
||||
std::vector<std::map<int, int>> extruder_ams_counts;
|
||||
for (const std::string& str : strs) {
|
||||
std::map<int, int> ams_count_info;
|
||||
if (str.empty()) {
|
||||
extruder_ams_counts.emplace_back(ams_count_info);
|
||||
continue;
|
||||
}
|
||||
std::vector<std::string> ams_infos;
|
||||
boost::algorithm::split(ams_infos, str, boost::algorithm::is_any_of("|"));
|
||||
for (const std::string& ams_info : ams_infos) {
|
||||
|
||||
Reference in New Issue
Block a user