Fix of SPE-1849, GH #11174: Access violation error when slicing

Fixed access of an undefined extruder at the start of G-code export
from wipe tower generator.
This commit is contained in:
Vojtech Bubnik 2023-08-29 10:56:54 +02:00
parent 59029a04de
commit 212bf21b2d

View File

@ -3256,7 +3256,7 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string
bool GCode::needs_retraction(const Polyline &travel, ExtrusionRole role)
{
if (travel.length() < scale_(EXTRUDER_CONFIG(retract_before_travel))) {
if (! m_writer.extruder() || travel.length() < scale_(EXTRUDER_CONFIG(retract_before_travel))) {
// skip retraction if the move is shorter than the configured threshold
return false;
}