Fix crash when slicing multi-material print with wipe tower (#12682)

The WipeTower2 code path never called construct_mesh(), leaving
wipe_tower_mesh_data as std::nullopt. GCode export then dereferenced
it unconditionally, triggering an assertion failure / crash.
This commit is contained in:
SoftFever
2026-03-09 13:31:11 +08:00
committed by GitHub
parent 0711c95abc
commit e6f6095834
4 changed files with 9 additions and 1 deletions

View File

@@ -3025,7 +3025,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
}
}
// wipe tower area
if (has_wipe_tower) {
if (has_wipe_tower && print.wipe_tower_data().wipe_tower_mesh_data) {
Polygon temp_Expoly = print.wipe_tower_data().wipe_tower_mesh_data->bottom;
area_sum_temp += temp_Expoly.area();
}