summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/namestore/plugin_rest_namestore.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c
index 4184d93a1..5a7e8c6cf 100644
--- a/src/namestore/plugin_rest_namestore.c
+++ b/src/namestore/plugin_rest_namestore.c
@@ -525,10 +525,14 @@ namestore_list_iteration (void *cls,
rd_filtered[j].data = rd[i].data;
j++;
}
- record_obj = GNUNET_JSON_from_gnsrecord (rname,
- rd_filtered,
- j);
- json_array_append_new (handle->resp_object, record_obj);
+ /** Only add if not empty **/
+ if (j > 0)
+ {
+ record_obj = GNUNET_JSON_from_gnsrecord (rname,
+ rd_filtered,
+ j);
+ json_array_append_new (handle->resp_object, record_obj);
+ }
GNUNET_NAMESTORE_zone_iterator_next (handle->list_it, 1);
}