Skip to content

Commit

Permalink
Check for null/undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Caldwell committed Oct 29, 2019
1 parent 1c5089e commit 3789603
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 3789603

Please sign in to comment.