Fix missing null pointer check

This commit is contained in:
Eric Fischer 2018-06-19 13:10:58 -07:00
parent 9dac499ab4
commit 262fbf26f0
2 changed files with 4 additions and 2 deletions

View File

@ -221,7 +221,7 @@ void check_crs(json_object *j, const char *reading) {
json_object *properties = json_hash_get(crs, "properties"); json_object *properties = json_hash_get(crs, "properties");
if (properties != NULL) { if (properties != NULL) {
json_object *name = json_hash_get(properties, "name"); json_object *name = json_hash_get(properties, "name");
if (name->type == JSON_STRING) { if (name != NULL && name->type == JSON_STRING) {
if (strcmp(name->string, projection->alias) != 0) { if (strcmp(name->string, projection->alias) != 0) {
if (!quiet) { if (!quiet) {
fprintf(stderr, "%s: Warning: GeoJSON specified projection \"%s\", not the expected \"%s\".\n", reading, name->string, projection->alias); fprintf(stderr, "%s: Warning: GeoJSON specified projection \"%s\", not the expected \"%s\".\n", reading, name->string, projection->alias);

View File

@ -1,4 +1,6 @@
{"type":"FeatureCollection","features":[ {"type":"FeatureCollection",
"crs": { "type": "name", "properties": { } },
"features":[
{"type":"Feature","properties":{ {"type":"Feature","properties":{
"boolean": true, "boolean": true,
"otherboolean": false, "otherboolean": false,