From 4520e1bb3e0222f9b02f01b4af894a2d5e4cc370 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Thu, 29 Oct 2020 23:12:31 +0900 Subject: [PATCH] Fix potential NRE in polling --- BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs b/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs index b4df6d389..cdedf894d 100644 --- a/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs +++ b/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs @@ -218,7 +218,7 @@ namespace BTCPayServer.Payments.Bitcoin } async Task UpdatePaymentStates(BTCPayWallet wallet, InvoiceEntity invoice) { - + List updatedPaymentEntities = new List(); var transactions = await wallet.GetTransactions(invoice.GetAllBitcoinPaymentData() .Select(p => p.Outpoint.Hash) @@ -371,7 +371,7 @@ namespace BTCPayServer.Payments.Bitcoin var address = network.NBXplorerNetwork.CreateAddress(strategy, coin.KeyPath, coin.ScriptPubKey); var paymentData = new BitcoinLikePaymentData(address, coin.Value, coin.OutPoint, - transaction.Transaction.RBF, coin.KeyPath); + transaction.Transaction is null ? true : transaction.Transaction.RBF, coin.KeyPath); var payment = await _InvoiceRepository.AddPayment(invoice.Id, coin.Timestamp, paymentData, network).ConfigureAwait(false); alreadyAccounted.Add(coin.OutPoint);