Skip to content

Commit

Permalink
fix(GeoJsonParser): fix firstCoordinates when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyGlt authored and mgermerie committed Apr 19, 2023
1 parent 23c16d2 commit e54f352
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Parser/GeoJsonParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function toFeatureType(jsonType) {

const keyProperties = ['type', 'geometry', 'properties'];

const firstCoordinates = a => (Array.isArray(a) && !isNaN(a[0]) ? a : firstCoordinates(a[0]));
const firstCoordinates = a => (a === undefined || (Array.isArray(a) && !isNaN(a[0])) ? a : firstCoordinates(a[0]));

function jsonFeatureToFeature(crsIn, json, collection) {
const jsonType = json.geometry.type.toLowerCase();
Expand Down

0 comments on commit e54f352

Please sign in to comment.