From ca43ac369faafd408ebf2f9df1c51f3cf27c52f3 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Thu, 19 Nov 2020 11:10:49 -0500 Subject: [PATCH] handle empty shells --- src/kiri/slice.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kiri/slice.js b/src/kiri/slice.js index ef4f0d69..cb21c485 100644 --- a/src/kiri/slice.js +++ b/src/kiri/slice.js @@ -76,7 +76,7 @@ * @returns {Polygon[]} array of top polygons */ Top.prototype.shellsAtDepth = function(depth) { - return this.shells.filter(poly => poly.depth === depth); + return this.shells ? this.shells.filter(poly => poly.depth === depth) : []; }; /** ******************************************************************