diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index f4f6cd366..af3b36f01 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -129,6 +129,8 @@ namespace BTCPayServer.Controllers private async Task GetInvoiceModel(string invoiceId, string cryptoCode) { + if (cryptoCode == null) + throw new ArgumentNullException(nameof(cryptoCode)); var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId); var network = _NetworkProvider.GetNetwork(cryptoCode); if (invoice == null || network == null || !invoice.Support(network)) @@ -183,6 +185,8 @@ namespace BTCPayServer.Controllers [Route("i/{invoiceId}/status")] public async Task GetStatus(string invoiceId, string cryptoCode) { + if (cryptoCode == null) + cryptoCode = "BTC"; var model = await GetInvoiceModel(invoiceId, cryptoCode); if (model == null) return NotFound(); diff --git a/BTCPayServer/Services/Invoices/InvoiceRepository.cs b/BTCPayServer/Services/Invoices/InvoiceRepository.cs index 85f5ae3f9..c9c64c836 100644 --- a/BTCPayServer/Services/Invoices/InvoiceRepository.cs +++ b/BTCPayServer/Services/Invoices/InvoiceRepository.cs @@ -256,7 +256,7 @@ namespace BTCPayServer.Services.Invoices { using (var tx = _Engine.GetTransaction()) { - tx.TextInsert("InvoiceSearch", Encoders.Base58.DecodeData(invoiceId), string.Join(" ", terms.Where(t => !String.IsNullOrWhiteSpace(t)))); + tx.TextAppend("InvoiceSearch", Encoders.Base58.DecodeData(invoiceId), string.Join(" ", terms.Where(t => !String.IsNullOrWhiteSpace(t)))); tx.Commit(); } });