mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Do not crash UI and background services after switching to BItcoin Only when you have altcoin payments
This commit is contained in:
@@ -104,10 +104,16 @@ namespace BTCPayServer.PaymentRequest
|
||||
Currency = entity.ProductInformation.Currency,
|
||||
ExpiryDate = entity.ExpirationTime.DateTime,
|
||||
Status = entity.GetInvoiceState().ToString(),
|
||||
Payments = entity.GetPayments().Select(paymentEntity =>
|
||||
Payments = entity
|
||||
.GetPayments()
|
||||
.Select(paymentEntity =>
|
||||
{
|
||||
var paymentData = paymentEntity.GetCryptoPaymentData();
|
||||
var paymentMethodId = paymentEntity.GetPaymentMethodId();
|
||||
if (paymentData is null || paymentMethodId is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string txId = paymentData.GetPaymentId();
|
||||
string link = GetTransactionLink(paymentMethodId, txId);
|
||||
@@ -118,7 +124,9 @@ namespace BTCPayServer.PaymentRequest
|
||||
Link = link,
|
||||
Id = txId
|
||||
};
|
||||
}).ToList()
|
||||
})
|
||||
.Where(payment => payment != null)
|
||||
.ToList()
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user