commit 4829e77bcb9e334b7cb0b348fc7d409f32b77c6b
parent ec59784cde7a4fdf320f7ba55d704ed5e009b001
Author: Florian Dold <florian.dold@gmail.com>
Date: Wed, 20 Apr 2016 01:42:16 +0200
fix abort due to proof that is NULL
Diffstat:
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git 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 */