Browse Source

Mask out (null) as a valid result in json_result

master
Con Kolivas 10 years ago
parent
commit
d526eb8a76
  1. 4
      src/generator.c

4
src/generator.c

@ -412,9 +412,11 @@ static json_t *json_result(json_t *val)
json_t *res_val = NULL, *err_val;
res_val = json_object_get(val, "result");
/* (null) is a valid result while no value is an error, so mask out
* (null) and only handle lack of result */
if (json_is_null(res_val))
res_val = NULL;
if (!res_val) {
else if (!res_val) {
char *ss;
err_val = json_object_get(val, "error");

Loading…
Cancel
Save