mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
Fix exception when saving checkout experience on new store (#2033)
This commit is contained in:
parent
d8f9075e2a
commit
793b1b56d9
@ -420,6 +420,7 @@ namespace BTCPayServer.Controllers
|
||||
}
|
||||
SetCryptoCurrencies(model, CurrentStore);
|
||||
model.SetLanguages(_LangService, model.DefaultLang);
|
||||
model.PaymentMethodCriteria??= new List<PaymentMethodCriteriaViewModel>();
|
||||
for (var index = 0; index < model.PaymentMethodCriteria.Count; index++)
|
||||
{
|
||||
var methodCriterion = model.PaymentMethodCriteria[index];
|
||||
@ -427,11 +428,13 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
if (!CurrencyValue.TryParse(methodCriterion.Value, out var value))
|
||||
{
|
||||
model.AddModelError(viewModel => viewModel.PaymentMethodCriteria[index].Value, $"{methodCriterion.PaymentMethod}: invalid format (1.0 USD)", this);
|
||||
model.AddModelError(viewModel => viewModel.PaymentMethodCriteria[index].Value,
|
||||
$"{methodCriterion.PaymentMethod}: invalid format (1.0 USD)", this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return View(model);
|
||||
|
Loading…
Reference in New Issue
Block a user