summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-12-18 23:26:20 +0100
committerFlorian Dold <florian@dold.me>2023-12-18 23:26:20 +0100
commit2db6888c511117a980a04159117c9e9db38e1c05 (patch)
treea5e6ed553317474a527fe42a3aaa2ecbd1a25d19
parentf22f5f89cc99fb0556b956b6432e4817d52378d2 (diff)
downloadwallet-core-2db6888c511117a980a04159117c9e9db38e1c05.tar.gz
wallet-core-2db6888c511117a980a04159117c9e9db38e1c05.tar.bz2
wallet-core-2db6888c511117a980a04159117c9e9db38e1c05.zip
wallet-core: do not crash for payments with zero coins
-rw-r--r--packages/taler-wallet-core/src/operations/pay-merchant.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-merchant.ts b/packages/taler-wallet-core/src/operations/pay-merchant.ts
index 078f0faf9..fb8a6d898 100644
--- a/packages/taler-wallet-core/src/operations/pay-merchant.ts
+++ b/packages/taler-wallet-core/src/operations/pay-merchant.ts
@@ -152,7 +152,7 @@ export async function getTotalPaymentCost(
ws: InternalWalletState,
pcs: PayCoinSelection,
): Promise<AmountJson> {
- const currency = Amounts.currencyOf(pcs.coinContributions[0]);
+ const currency = Amounts.currencyOf(pcs.paymentAmount);
return ws.db
.mktx((x) => [x.coins, x.denominations])
.runReadOnly(async (tx) => {