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) : []; }; /** ******************************************************************