diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-04-20 01:42:16 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-04-20 01:42:16 +0200 |
commit | 4829e77bcb9e334b7cb0b348fc7d409f32b77c6b (patch) | |
tree | 3b9c0a604e33fd41f618b9c88f6aa440b0e411dd | |
parent | ec59784cde7a4fdf320f7ba55d704ed5e009b001 (diff) | |
download | merchant-4829e77bcb9e334b7cb0b348fc7d409f32b77c6b.tar.gz merchant-4829e77bcb9e334b7cb0b348fc7d409f32b77c6b.tar.bz2 merchant-4829e77bcb9e334b7cb0b348fc7d409f32b77c6b.zip |
fix abort due to proof that is NULL
-rw-r--r-- | src/backend/taler-merchant-httpd_pay.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c index caee11db..9092bbd9 100644 --- a/src/backend/taler-merchant-httpd_pay.c +++ b/src/backend/taler-merchant-httpd_pay.c @@ -291,10 +291,21 @@ deposit_cb (void *cls, http_status); /* Transaction failed; stop all other ongoing deposits */ abort_deposit (pc); - /* Forward error including 'proof' for the body */ - resume_pay_with_response (pc, - http_status, - TMH_RESPONSE_make_json (proof)); + + if (NULL == proof) + { + /* FIXME: is this the right code for when the exchange fails? */ + resume_pay_with_response (pc, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TMH_RESPONSE_make_internal_error ("Exchange failed, no proof available")); + } + else + { + /* Forward error including 'proof' for the body */ + resume_pay_with_response (pc, + http_status, + TMH_RESPONSE_make_json (proof)); + } return; } /* store result to DB */ |