diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-09-09 22:27:53 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-09-09 22:27:53 +0200 |
commit | cd3071d864eda94562851796f5559e3e90c2d62f (patch) | |
tree | 621f4ea5afe72fc35bc067cbb7b7d45ad1629aef /src | |
parent | 155966b731904f4979c51e0d0bd690d65c881042 (diff) | |
download | merchant-cd3071d864eda94562851796f5559e3e90c2d62f.tar.gz merchant-cd3071d864eda94562851796f5559e3e90c2d62f.tar.bz2 merchant-cd3071d864eda94562851796f5559e3e90c2d62f.zip |
work on #5092, handle failure in easy case without asserting
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/taler-merchant-httpd_responses.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/taler-merchant-httpd_responses.c b/src/backend/taler-merchant-httpd_responses.c index 1ea2600e..f5f994e8 100644 --- a/src/backend/taler-merchant-httpd_responses.c +++ b/src/backend/taler-merchant-httpd_responses.c @@ -44,7 +44,11 @@ TMH_RESPONSE_make_json (const json_t *json) json_str = json_dumps (json, JSON_INDENT(2)); - GNUNET_assert (NULL != json_str); + if (NULL == json_str) + { + GNUNET_break (0); + return NULL; + } resp = MHD_create_response_from_buffer (strlen (json_str), json_str, MHD_RESPMEM_MUST_FREE); @@ -268,7 +272,7 @@ TMH_RESPONSE_reply_not_found (struct MHD_Connection *connection, return TMH_RESPONSE_reply_json_pack (connection, MHD_HTTP_NOT_FOUND, "{s:I, s:s}", - "code", (json_int_t) ec, + "code", (json_int_t) ec, "error", object); } |