From ac2356f66a02a557e8c4a1dc97f87de039e529b6 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 30 Mar 2013 00:36:14 +0100 Subject: [PATCH] Don't crash at the end of empty prints. #1042 --- lib/Slic3r/Print.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 6df75f2fe..e19ec2730 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -1021,7 +1021,7 @@ sub write_gcode { $self->total_extrusion_length($gcodegen->total_extrusion_length); # write end commands to file - print $fh $gcodegen->retract; + print $fh $gcodegen->retract if $gcodegen->extruder; # empty prints don't even set an extruder print $fh $gcodegen->set_fan(0); printf $fh "%s\n", $Slic3r::Config->replace_options($Slic3r::Config->end_gcode);