Fix potential NRE in polling

This commit is contained in:
nicolas.dorier
2020-10-29 23:12:31 +09:00
parent 3b14585d1a
commit 4520e1bb3e

View File

@@ -218,7 +218,7 @@ namespace BTCPayServer.Payments.Bitcoin
}
async Task<InvoiceEntity> UpdatePaymentStates(BTCPayWallet wallet, InvoiceEntity invoice)
{
List<PaymentEntity> updatedPaymentEntities = new List<PaymentEntity>();
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);