NYCPlanning / labs-postgis-preview

A lightweight express app and leaflet frontend for previewing PostGIS queries
MIT License
277 stars 57 forks source link

Handle mix of valid and null geometries #75

Closed jczaplew closed 6 years ago

jczaplew commented 6 years ago

When a query result contains some rows with a valid geometry and others with a NULL geometry the following error is thrown:

App.js:63 Uncaught (in promise) TypeError: Cannot read property 'type' of null
    at <anonymous>:85:62

This occurs because line 63 of App.js checks the geometry type by looking at the first item in the GeoJSON FeatureCollection, but if that item is NULL the error is thrown.