-allow NULL in amounts

This commit is contained in:
Christian Grothoff 2021-07-31 23:07:03 +02:00
parent 33a28efef7
commit 243d39920c
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -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;