Fix NRE if invoice not found

This commit is contained in:
nicolas.dorier
2021-03-06 13:25:40 +09:00
parent bd447b6c79
commit cc4e46d212

View File

@@ -70,7 +70,7 @@ namespace BTCPayServer.Controllers.GreenField
}
var invoice = await _invoiceRepository.GetInvoice(invoiceId, true);
if (invoice.StoreId != store.Id)
if (invoice?.StoreId != store.Id)
{
return NotFound();
}