Permalink
Browse files

handle NULL passed to json_objct_object_get

Patch via Nikola Pajkovsky


git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@75 327403b1-1117-474d-bef2-5cb71233fd97
  • Loading branch information...
jehiah committed May 26, 2011
1 parent 43d2f41 commit 276123efe09dde04a864317a3c273e4bd2b4fd26
Showing with 1 addition and 0 deletions.
  1. +1 −0 json_object.c
View
@@ -256,6 +256,7 @@ void json_object_object_add(struct json_object* jso, const char *key,
struct json_object* json_object_object_get(struct json_object* jso, const char *key)
{
+ if(!jso) return NULL;
return (struct json_object*) lh_table_lookup(jso->o.c_object, key);
}

0 comments on commit 276123e

Please sign in to comment.