Fix crash if impossible to get the network of a payment

This commit is contained in:
nicolas.dorier
2020-08-13 16:29:04 +09:00
parent f323d06f5c
commit d05f914841
3 changed files with 5 additions and 1 deletions

View File

@@ -144,6 +144,7 @@ namespace BTCPayServer.Controllers
.Select(o => new PaymentMethodId(o, PaymentTypes.BTCLike))
.ToList();
var defaultRefund = invoice.Payments.Select(p => p.GetBlob(_NetworkProvider))
.Where(p => p != null)
.Select(p => p.GetPaymentMethodId().CryptoCode)
.FirstOrDefault();
// TODO: What if no option?