diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index e19637f28..2b7725324 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -119,7 +119,8 @@ namespace BTCPayServer.Controllers private async Task GetInvoiceModel(string invoiceId, string cryptoCode) { var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId); - + if (invoice == null) + return null; var store = await _StoreRepository.FindStore(invoice.StoreId); if (cryptoCode == null) cryptoCode = store.GetDefaultCrypto();