Add null pointer check when testing for bare geometry in GeoJSON

This commit is contained in:
Eric Fischer
2017-11-21 15:01:33 -08:00
parent ac67013930
commit 9964784e77
3 changed files with 32 additions and 2 deletions
+1 -1
View File
@@ -278,7 +278,7 @@ void parse_json(struct serialization_state *sst, json_pull *jp, int layer, std::
if (is_geometry) {
if (j->parent != NULL) {
if (j->parent->type == JSON_ARRAY) {
if (j->parent->type == JSON_ARRAY && j->parent->parent != NULL) {
if (j->parent->parent->type == JSON_HASH) {
json_object *geometries = json_hash_get(j->parent->parent, "geometries");
if (geometries != NULL) {