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
No known key found for this signature in database
GPG key ID: 6618763EF09186FE

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