1
0
mirror of https://github.com/haiwen/libsearpc.git synced 2025-04-28 02:30:08 +00:00

Merge pull request #42 from haiwen/json_t_is_null

handle json is null
This commit is contained in:
Jiaqiang Xu 2019-09-10 11:09:57 +08:00 committed by GitHub
commit c137594507
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,7 +144,10 @@ searpc_set_objlist_to_ret_object (json_t *object, GList *ret)
void void
searpc_set_json_to_ret_object (json_t *object, json_t *ret) searpc_set_json_to_ret_object (json_t *object, json_t *ret)
{ {
json_object_set_new (object, "ret", ret); if (ret == NULL)
json_object_set_new(object, "ret", json_null ());
else
json_object_set_new (object, "ret", ret);
} }
char * char *