handle empty shells

This commit is contained in:
Stewart Allen 2020-11-19 11:10:49 -05:00
commit ca43ac369f

View file

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