FIX: clien crash when double extruder filament preset switch to single

extruder filament preset

Jira: STUDIO-12689
Change-Id: Ifab01dcbc0f42684655e3feae923bfeb82965d01
(cherry picked from commit 0b57ff3b537cf7c2fdc503ffd3e5b5567e84c5d4)
This commit is contained in:
weiting.ji
2025-07-02 17:27:55 +08:00
committed by Noisyfox
parent 013d2d8d6e
commit 6075302f98
2 changed files with 6 additions and 2 deletions

View File

@@ -3573,7 +3573,9 @@ void TabFilament::update_filament_overrides_page(const DynamicPrintConfig* print
// "filament_seam_gap"
};
const int extruder_idx = m_variant_combo->GetSelection(); // #ys_FIXME
const int selection = 0; //m_variant_combo->GetSelection(); // TODO: Orca hack
auto opt = dynamic_cast<ConfigOptionVectorBase *>(m_config->option("filament_retraction_length"));
const int extruder_idx = selection < 0 || selection >= static_cast<int>(opt->size()) ? 0 : selection;
const bool have_retract_length = dynamic_cast<ConfigOptionVectorBase *>(m_config->option("filament_retraction_length"))->is_nil(extruder_idx) ||
m_config->opt_float("filament_retraction_length", extruder_idx) > 0;