From b422537cc493d2eabd8cfcbfa30ab45b88c1d5da Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Thu, 15 Dec 2011 20:36:46 +0100 Subject: [PATCH] Bugfix: do not die when no layers are detected at all --- 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 552e92002..0b3587432 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -129,7 +129,7 @@ sub new_from_mesh { } # remove empty layers from bottom - while (!@{$print->layers->[0]->slices}) { + while (@{$print->layers} && !@{$print->layers->[0]->slices}) { shift @{$print->layers}; for (my $i = 0; $i <= $#{$print->layers}; $i++) { $print->layers->[$i]->id($i);