mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Fix null reference error when "destinations" field is not specified or empty when creating a new wallet transaction
fix #3537
This commit is contained in:
parent
1e1198f4ec
commit
d372cbad74
1 changed files with 10 additions and 0 deletions
|
@ -282,6 +282,16 @@ namespace BTCPayServer.Controllers.Greenfield
|
|||
return this.CreateAPIError(503, "not-available", $"You need to allow non-admins to use hotwallets for their stores (in /server/policies)");
|
||||
}
|
||||
|
||||
if (request.Destinations == null || !request.Destinations.Any())
|
||||
{
|
||||
ModelState.AddModelError(
|
||||
nameof(request.Destinations),
|
||||
"At least one destination must be specified"
|
||||
);
|
||||
|
||||
return this.CreateValidationError(ModelState);
|
||||
}
|
||||
|
||||
var explorerClient = _explorerClientProvider.GetExplorerClient(cryptoCode);
|
||||
var wallet = _btcPayWalletProvider.GetWallet(network);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue