mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 10:40:29 +01:00
Improve error checks
This commit is contained in:
parent
f0fc0441bd
commit
0dcd834535
@ -119,7 +119,7 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
if (string.IsNullOrEmpty(paymentMethodData.DerivationScheme))
|
||||
if (string.IsNullOrEmpty(paymentMethodData?.DerivationScheme))
|
||||
{
|
||||
ModelState.AddModelError(nameof(OnChainPaymentMethodData.DerivationScheme),
|
||||
"Missing derivationScheme");
|
||||
@ -188,6 +188,14 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(paymentMethodData?.DerivationScheme))
|
||||
{
|
||||
ModelState.AddModelError(nameof(OnChainPaymentMethodData.DerivationScheme),
|
||||
"Missing derivationScheme");
|
||||
}
|
||||
if (!ModelState.IsValid)
|
||||
return this.CreateValidationError(ModelState);
|
||||
|
||||
try
|
||||
{
|
||||
var store = Store;
|
||||
|
Loading…
Reference in New Issue
Block a user