From 68e302fe27653f2b3cff0c18f254ba59f02533a5 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Fri, 23 Nov 2012 11:24:04 +0100 Subject: [PATCH] Fix exporting G-code --- lib/Slic3r/Print.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 9ca18cbd..0ac8c11f 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -434,8 +434,8 @@ sub export_gcode { $self->make_brim; # must come after make_skirt # output everything to a G-code file - my $output_file = $params{output_file} ? $self->expanded_output_filepath($params{output_file}) : ''; - $status_cb->(90, "Exporting G-code to $output_file"); + my $output_file = $self->expanded_output_filepath($params{output_file}); + $status_cb->(90, "Exporting G-code" . ($output_file ? " to $output_file" : "")); $self->write_gcode($params{output_fh} || $output_file); # run post-processing scripts @@ -943,6 +943,7 @@ sub expanded_output_filepath { # if no input file was supplied, take the first one from our objects $input_file ||= $self->objects->[0]->input_file; + return undef if !defined $input_file; # if output path is an existing directory, we take that and append # the specified filename format