From 19c132e79c78a70d9231e19a1dc4a46d23e1df2e Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 8 Aug 2018 14:17:08 -0700 Subject: [PATCH] Be more cautious about use of a null feature for bare geometries --- geojson-loop.cpp | 2 +- jsontool.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/geojson-loop.cpp b/geojson-loop.cpp index 7ca0d514..feebe695 100644 --- a/geojson-loop.cpp +++ b/geojson-loop.cpp @@ -113,7 +113,7 @@ void parse_json(json_feature_action *jfa, json_pull *jp) { } found_geometries++; - jfa->add_feature(j, false, NULL, NULL, NULL, NULL); + jfa->add_feature(j, false, NULL, NULL, NULL, j); json_free(j); continue; } diff --git a/jsontool.cpp b/jsontool.cpp index 0dcc0b87..cb80abe9 100644 --- a/jsontool.cpp +++ b/jsontool.cpp @@ -365,7 +365,7 @@ void join_csv(json_object *j) { struct json_join_action : json_feature_action { int add_feature(json_object *geometry, bool, json_object *, json_object *, json_object *, json_object *feature) { - if (feature != NULL) { + if (feature != geometry) { // a real feature, not a bare geometry if (csvfile != NULL) { join_csv(feature); }