From bafdcb04ed4c3ce32e0350e433edc91747bb0fc3 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Wed, 10 Jan 2018 18:33:05 +0900 Subject: [PATCH] fix error if invoice is requested without existing --- BTCPayServer/Controllers/InvoiceController.UI.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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();