From 8a01cb9e96f2c3552c466956b739d2cd5b46176a Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 2 Jun 2013 19:44:59 +0200 Subject: [PATCH] Generate a better error when input file is too thin and no layers could be generated. #1127 --- lib/Slic3r/Print/Object.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index 11339955a6..6e80673827 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -184,13 +184,13 @@ sub slice { $self->meshes->[$region_id] = undef; # free memory } - die "Invalid input file\n" if !@{$self->layers}; # free memory $self->meshes(undef); # remove last layer(s) if empty - pop @{$self->layers} while !map @{$_->lines}, @{$self->layers->[-1]->regions}; + pop @{$self->layers} while @{$self->layers} && (!map @{$_->lines}, @{$self->layers->[-1]->regions}); + die "Invalid or too thin input file: no layers could be generated\n" if !@{$self->layers}; foreach my $layer (@{ $self->layers }) { # make sure all layers contain layer region objects for all regions