From a82c7af104e186fb92c15b709fb3ed838e871410 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 4 Jun 2023 01:31:43 +0200 Subject: allow NULL for object/array --- src/json/json_helper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/json/json_helper.c b/src/json/json_helper.c index 61257e62a..515cc4c7f 100644 --- a/src/json/json_helper.c +++ b/src/json/json_helper.c @@ -368,6 +368,8 @@ parse_object_const (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) { + if (NULL == root) + return GNUNET_OK; if (! json_is_object (root)) { GNUNET_break_op (0); @@ -409,6 +411,8 @@ parse_array_const (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) { + if (NULL == root) + return GNUNET_OK; if (! json_is_array (root)) { GNUNET_break_op (0); -- cgit v1.2.3