diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-07-31 23:07:03 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-07-31 23:07:03 +0200 |
commit | 243d39920cd2006400a2a3a0ca275806218d1b30 (patch) | |
tree | 30db21fba06169cb5706c2765e6e5be978db4984 | |
parent | 33a28efef74d1db0c08a8e9e3facf3656b4b29e1 (diff) | |
download | exchange-243d39920cd2006400a2a3a0ca275806218d1b30.tar.xz |
-allow NULL in amounts
-rw-r--r-- | src/json/json_pack.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; |