FIX: config: fix some potential crash when load gcode.3mf

jira: STUDIO-9131
reason: sometimes the popup window causes Print::Apply using invalid configs
Change-Id: I1764050f7177a65625f4668b2e1f86c80a4d4e5a
(cherry picked from commit 5a32ce3599883b9976e32ef2c864967efd52fbc2)
This commit is contained in:
lane.wei 2024-12-10 21:52:28 +08:00
parent 90ffa139a5
commit e16da5da85
1 changed files with 6 additions and 0 deletions

View File

@ -6228,6 +6228,9 @@ std::vector<int> DynamicPrintConfig::update_values_to_printer_extruders(DynamicP
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(", Line %1%: could not found extruder_type %2%, nozzle_volume_type %3%, extruder_index %4%")
%__LINE__ %s_keys_names_ExtruderType[extruder_type] % s_keys_names_NozzleVolumeType[nozzle_volume_type] % (e_index+1);
assert(false);
//for some updates happens in a invalid state(caused by popup window)
//we need to avoid crash
variant_index[e_index] = 0;
}
}
}
@ -6383,6 +6386,9 @@ void DynamicPrintConfig::update_values_to_printer_extruders_for_multiple_filamen
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(", Line %1%: could not found extruder_type %2%, nozzle_volume_type %3%, filament_index %4%, extruder index %5%")
%__LINE__ %s_keys_names_ExtruderType[extruder_type] % s_keys_names_NozzleVolumeType[nozzle_volume_type] % (f_index+1) %filament_maps[f_index];
assert(false);
//for some updates happens in a invalid state(caused by popup window)
//we need to avoid crash
variant_index[f_index] = 0;
}
}