mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
fix error if invoice is requested without existing
This commit is contained in:
@@ -119,7 +119,8 @@ namespace BTCPayServer.Controllers
|
|||||||
private async Task<PaymentModel> GetInvoiceModel(string invoiceId, string cryptoCode)
|
private async Task<PaymentModel> GetInvoiceModel(string invoiceId, string cryptoCode)
|
||||||
{
|
{
|
||||||
var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId);
|
var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId);
|
||||||
|
if (invoice == null)
|
||||||
|
return null;
|
||||||
var store = await _StoreRepository.FindStore(invoice.StoreId);
|
var store = await _StoreRepository.FindStore(invoice.StoreId);
|
||||||
if (cryptoCode == null)
|
if (cryptoCode == null)
|
||||||
cryptoCode = store.GetDefaultCrypto();
|
cryptoCode = store.GetDefaultCrypto();
|
||||||
|
|||||||
Reference in New Issue
Block a user