Fix Crash (access violation) instead of the "empty first layer" (#17565)

This commit is contained in:
Rodrigo Faselli authored and GitHub committed 2026-11-15 11:51:10 -03:00
1 parent 8b8d573a85
commit 0e8e95d516
1 file changed
+2 -1
+2 -1
View File
@@ -1286,7 +1286,8 @@ std::vector<WipeTower::ToolChangeResult> WipeTower2::prime(
toolchange_Load(writer, cleaning_box); // Prime the tool.
if (idx_tool + 1 == tools.size()) {
// Last tool should not be unloaded, but it should be wiped enough to become of a pure color.
toolchange_Wipe(writer, cleaning_box, wipe_volumes[tools[idx_tool-1]][tool], false, true);
const float wipe_volume = idx_tool == 0 ? 0.f : wipe_volumes[tools[idx_tool - 1]][tool];
toolchange_Wipe(writer, cleaning_box, wipe_volume, false, true);
} else {
// Ram the hot material out of the melt zone, retract the filament into the cooling tubes and let it cool.
//writer.travel(writer.x(), writer.y() + m_perimeter_width, 7200);