Skip to content

Commit

Permalink
make geojson parser more stable
Browse files Browse the repository at this point in the history
  • Loading branch information
stmitt committed May 2, 2024
1 parent 6e44b28 commit d247af2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shared/src/map/layers/tiled/vector/geojson/GeoJsonParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class GeoJsonParser {

std::shared_ptr<GeoJson> geoJson = std::make_shared<GeoJson>();
for (const auto &feature: geojson["features"]) {
if (!feature["geometry"].is_object() ||
if (!feature["geometry"] ||
!feature["geometry"].is_object() ||
!feature["geometry"]["type"].is_string() ||
!feature["geometry"]["coordinates"].is_array()) {
LogError <<= "Geojson feature is not valid";
Expand Down

0 comments on commit d247af2

Please sign in to comment.