1
0
mirror of https://github.com/haiwen/libsearpc.git synced 2025-07-18 15:31:04 +00:00

handle json is null

This commit is contained in:
Xiangyue Cai 2019-09-10 10:48:10 +08:00
parent c185be9413
commit faaff4cf7b

View File

@ -144,6 +144,9 @@ 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)
{ {
if (ret == NULL)
json_object_set_new(object, "ret", json_null ());
else
json_object_set_new (object, "ret", ret); json_object_set_new (object, "ret", ret);
} }