Skip to content

Commit

Permalink
Merge pull request #595 from openmobilemaps/bugfix/geojson-feature-id
Browse files Browse the repository at this point in the history
  • Loading branch information
maerki authored Feb 13, 2024
2 parents 339e233 + e0850f7 commit a907f7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/src/map/layers/tiled/vector/geojson/GeoJsonParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class GeoJsonParser {

const auto &properties = parseProperties(feature["properties"]);

if(feature["id"].is_string()) {
if(feature.contains("id") && feature["id"].is_string()) {
geometry->featureContext = std::make_shared<FeatureContext>(geomType, properties, feature["id"].get<std::string>());
} else {
geometry->featureContext = std::make_shared<FeatureContext>(geomType, properties, generator.generateUUID());
Expand Down Expand Up @@ -124,7 +124,7 @@ class GeoJsonParser {
continue;
}

if(!feature["id"].is_string()) {
if(!feature.contains("id") || !feature["id"].is_string()) {
continue;
}

Expand Down

0 comments on commit a907f7b

Please sign in to comment.