Make sure checkout is not null in createinvoice

This commit is contained in:
nicolas.dorier
2020-12-08 14:54:24 +09:00
parent 97b00053c4
commit dd5fd2e5bb

View File

@@ -113,7 +113,7 @@ namespace BTCPayServer.Controllers.GreenField
{ {
ModelState.AddModelError(nameof(request.Currency), "Currency is required"); ModelState.AddModelError(nameof(request.Currency), "Currency is required");
} }
request.Checkout = request.Checkout ?? new CreateInvoiceRequest.CheckoutOptions();
if (request.Checkout.PaymentMethods?.Any() is true) if (request.Checkout.PaymentMethods?.Any() is true)
{ {
for (int i = 0; i < request.Checkout.PaymentMethods.Length; i++) for (int i = 0; i < request.Checkout.PaymentMethods.Length; i++)