fix error if invoice is requested without existing

This commit is contained in:
nicolas.dorier 2018-01-10 18:33:05 +09:00
parent cb4468d3b3
commit bafdcb04ed

View file

@ -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();