From 243d39920cd2006400a2a3a0ca275806218d1b30 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 31 Jul 2021 23:07:03 +0200 Subject: -allow NULL in amounts --- src/json/json_pack.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/json/json_pack.c') diff --git a/src/json/json_pack.c b/src/json/json_pack.c index 1859e264a..a03b09e2c 100644 --- a/src/json/json_pack.c +++ b/src/json/json_pack.c @@ -113,7 +113,9 @@ TALER_JSON_pack_amount (const char *name, { struct GNUNET_JSON_PackSpec ps = { .field_name = name, - .object = TALER_JSON_from_amount (amount) + .object = (NULL != amount) + ? TALER_JSON_from_amount (amount) + : NULL }; return ps; @@ -126,7 +128,9 @@ TALER_JSON_pack_amount_nbo (const char *name, { struct GNUNET_JSON_PackSpec ps = { .field_name = name, - .object = TALER_JSON_from_amount_nbo (amount) + .object = (NULL != amount) + ? TALER_JSON_from_amount_nbo (amount) + : NULL }; return ps; -- cgit v1.2.3