mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Improve error checks
This commit is contained in:
@@ -119,7 +119,7 @@ namespace BTCPayServer.Controllers.GreenField
|
|||||||
{
|
{
|
||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
if (string.IsNullOrEmpty(paymentMethodData.DerivationScheme))
|
if (string.IsNullOrEmpty(paymentMethodData?.DerivationScheme))
|
||||||
{
|
{
|
||||||
ModelState.AddModelError(nameof(OnChainPaymentMethodData.DerivationScheme),
|
ModelState.AddModelError(nameof(OnChainPaymentMethodData.DerivationScheme),
|
||||||
"Missing derivationScheme");
|
"Missing derivationScheme");
|
||||||
@@ -188,6 +188,14 @@ namespace BTCPayServer.Controllers.GreenField
|
|||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(paymentMethodData?.DerivationScheme))
|
||||||
|
{
|
||||||
|
ModelState.AddModelError(nameof(OnChainPaymentMethodData.DerivationScheme),
|
||||||
|
"Missing derivationScheme");
|
||||||
|
}
|
||||||
|
if (!ModelState.IsValid)
|
||||||
|
return this.CreateValidationError(ModelState);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var store = Store;
|
var store = Store;
|
||||||
|
|||||||
Reference in New Issue
Block a user