commit be835f4bb16fa956e03127f294e888f6cf1f8701
parent 0a0fe09e9b144e96d4c6b7f1dab937f49de58f08
Author: Florian Dold <florian.dold@gmail.com>
Date: Tue, 23 Jan 2018 19:21:56 +0100
return error instead of crashing on /pay with zero coins
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c
@@ -625,7 +625,9 @@ check_payment_sufficient (struct PayContext *pc)
struct TALER_Amount wire_fee_customer_contribution;
struct TALER_Amount total_wire_fee;
- GNUNET_assert (0 != pc->coins_cnt);
+ if (0 == pc->coins_cnt)
+ return TALER_EC_PAY_PAYMENT_INSUFFICIENT;
+
acc_fee = pc->dc[0].deposit_fee;
total_wire_fee = pc->dc[0].wire_fee;
acc_amount = pc->dc[0].amount_with_fee;