mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
API: Fix for invoice not found (#2148)
In case the invoice ID was invalid, this resulted in an exception instead of a 404.
This commit is contained in:
@@ -263,7 +263,7 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
}
|
||||
|
||||
var invoice = await _invoiceRepository.GetInvoice(invoiceId, true);
|
||||
if (invoice.StoreId != store.Id)
|
||||
if (invoice?.StoreId != store.Id)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user