mirror of
https://github.com/akheron/jansson.git
synced 2025-04-06 05:55:05 +00:00
Check for key == NULL in json_object_get and json_object_del
This commit is contained in:
parent
9c8b3c833f
commit
98610bfcec
1 changed files with 2 additions and 2 deletions
|
@ -76,7 +76,7 @@ json_t *json_object_get(const json_t *json, const char *key)
|
|||
{
|
||||
json_object_t *object;
|
||||
|
||||
if(!json_is_object(json))
|
||||
if(!key || !json_is_object(json))
|
||||
return NULL;
|
||||
|
||||
object = json_to_object(json);
|
||||
|
@ -121,7 +121,7 @@ int json_object_del(json_t *json, const char *key)
|
|||
{
|
||||
json_object_t *object;
|
||||
|
||||
if(!json_is_object(json))
|
||||
if(!key || !json_is_object(json))
|
||||
return -1;
|
||||
|
||||
object = json_to_object(json);
|
||||
|
|
Loading…
Add table
Reference in a new issue