summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/json/json_pack.c8
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;