From e16da5da85bc8b758e79223581c21fdd98a89a25 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Tue, 10 Dec 2024 21:52:28 +0800 Subject: [PATCH] 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) --- src/libslic3r/PrintConfig.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 68dffea9f..1aa4df765 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -6228,6 +6228,9 @@ std::vector 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; } }