Ensure submitting empty currency does not break update PoS page (#2376)

This commit is contained in:
Umar Bolatov
2021-03-29 22:26:33 -07:00
committed by GitHub
parent 1aa233ca47
commit 120c7b9730

View File

@@ -161,6 +161,11 @@ namespace BTCPayServer.Controllers
[Route("{appId}/settings/pos")]
public async Task<IActionResult> UpdatePointOfSale(string appId, UpdatePointOfSaleViewModel vm)
{
if (!ModelState.IsValid)
{
return View(vm);
}
if (_currencies.GetCurrencyData(vm.Currency, false) == null)
ModelState.AddModelError(nameof(vm.Currency), "Invalid currency");
try