From 9ab81880c9a171a35ea386b0089b532638b209d1 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 16 Nov 2011 10:26:47 +0100 Subject: [PATCH] Throw a fatal exception if no layers are detected --- lib/Slic3r/STL.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Slic3r/STL.pm b/lib/Slic3r/STL.pm index 872957b0b..4536c8892 100644 --- a/lib/Slic3r/STL.pm +++ b/lib/Slic3r/STL.pm @@ -87,6 +87,8 @@ sub parse_file { } } + die "Invalid input file\n" if !@{$print->layers}; + # remove last layer if empty # (we might have created it because of the $max_layer = ... + 1 code below) pop @{$print->layers} if !@{$print->layers->[-1]->surfaces} && !@{$print->layers->[-1]->lines};