diff --git a/x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js b/x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js index 97f3171afbb392..59cfc7b486bdd9 100644 --- a/x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js +++ b/x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js @@ -38,7 +38,13 @@ export class GeojsonFileSource extends AbstractVectorSource { static createDescriptor(geoJson, name) { // Wrap feature as feature collection if needed let featureCollection; - if (geoJson.type === 'FeatureCollection') { + + if (!geoJson) { + featureCollection = { + type: 'FeatureCollection', + features: [] + }; + } else if (geoJson.type === 'FeatureCollection') { featureCollection = geoJson; } else if (geoJson.type === 'Feature') { featureCollection = {