fix clone/getZ when poly empty

This commit is contained in:
Stewart Allen 2025-01-08 22:53:55 -05:00
commit aa0dacde13

View file

@ -965,7 +965,7 @@ class Polygon {
* @returns {number} z value of first point * @returns {number} z value of first point
*/ */
getZ(i) { getZ(i) {
return this.z !== undefined ? this.z : this.points[i || 0].z; return this.z !== undefined ? this.z : this.points[i || 0]?.z || 0;
} }
/** /**