mapbox / shp-write

create and write to shapefiles in pure javascript
BSD 3-Clause "New" or "Revised" License
290 stars 186 forks source link

calling zip on a collection with only points and polygons hangs indefinitely #43

Closed symbyte closed 7 years ago

symbyte commented 7 years ago

the geojson.line(features) call on a feature collection that does not contain any line features returns an empty array nested inside an array causing the l.geometries.length to always return true, which causes and attempt to pefrorm a write on an empty array of geometries, which causes the write call to never return, and thus keeps the zip function from finishing.

this is avoided by checking the length of the nested array instead.

PR for fix: https://github.com/mapbox/shp-write/pull/42